# spacy 自然语言处理 (NLP) 和文本处理的开源库 ## Usage ``` python -m venv .env source .env/bin/activate pip install -U pip setuptools wheel pip install spacy import spacy # 加载英文模型 nlp = spacy.load("en_core_web_sm") # 文本 text = "Apple is looking at buying U.K. startup for $1 billion" # 处理文本 doc = nlp(text) # 输出分词和词性标注结果 for token in doc: print(token.text, token.pos_) ```