@@ -10,4 +10,20 @@ 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_)
```