本文整理匯總了Python中spacy.tokens.Doc.is_tagged方法的典型用法代碼示例。如果您正苦於以下問題:Python Doc.is_tagged方法的具體用法?Python Doc.is_tagged怎麽用?Python Doc.is_tagged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類spacy.tokens.Doc
的用法示例。
在下文中一共展示了Doc.is_tagged方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_issue599
# 需要導入模塊: from spacy.tokens import Doc [as 別名]
# 或者: from spacy.tokens.Doc import is_tagged [as 別名]
def test_issue599(en_vocab):
doc = Doc(en_vocab)
doc.is_tagged = True
doc.is_parsed = True
doc2 = Doc(doc.vocab)
doc2.from_bytes(doc.to_bytes())
assert doc2.is_parsed
示例2: test_issue1834
# 需要導入模塊: from spacy.tokens import Doc [as 別名]
# 或者: from spacy.tokens.Doc import is_tagged [as 別名]
def test_issue1834():
"""Test that sentence boundaries & parse/tag flags are not lost
during serialization."""
string = "This is a first sentence . And another one"
doc = Doc(Vocab(), words=string.split())
doc[6].sent_start = True
new_doc = Doc(doc.vocab).from_bytes(doc.to_bytes())
assert new_doc[6].sent_start
assert not new_doc.is_parsed
assert not new_doc.is_tagged
doc.is_parsed = True
doc.is_tagged = True
new_doc = Doc(doc.vocab).from_bytes(doc.to_bytes())
assert new_doc.is_parsed
assert new_doc.is_tagged