我想通过以下操作找出.ent_iob_
是什么:
doc = nlp('Hello World!')
token = doc[0]
token.ent_iob_?
帮助返回了这些信息:
Type: str
String form: O
Length: 1
Docstring:
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or
errors is specified, then the object must expose a data buffer
that will be decoded using the given encoding and error handler.
Otherwise, returns the result of object.__str__() (if defined)
or repr(object).
encoding defaults to sys.getdefaultencoding().
errors defaults to 'strict'.
代替此:
"""
IOB code of named entity tag. "B" means the token begins an entity, "I" means it is inside an entity, "O" means it is outside an entity, and "" means no entity tag is set.
"""
有人可以指出我做错了什么吗?预先谢谢你!
答案 0 :(得分:0)
我只是不小心发现了这一点:
spacy.tokens.token.Token.ent_iob_?
将返回所需的说明:
Type: getset_descriptor
String form: <attribute 'ent_iob_' of 'spacy.tokens.token.Token' objects>
Docstring:
IOB code of named entity tag. "B" means the token begins an entity,
"I" means it is inside an entity, "O" means it is outside an entity,
and "" means no entity tag is set.
RETURNS (unicode): IOB code of named entity tag.