spaCy - Doc . _ _iter_ _ 方法



Doc 类中的这种方法将迭代来自它们的标记对象,而这些标记对象可以轻松访问。

示例

一个示例 Doc . _ _iter_ _ 如下所示:

import spacy
nlp_model = spacy.load("en_core_web_sm")
doc = nlp_model("This is Tutorialspoint.com.")
[t.text for t in doc]

输出

['This', 'is', 'Tutorialspoint.com']
spacy_containers.htm
广告
© . All rights reserved.