mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Fix morph in Doc.to_json
This commit is contained in:
parent
741796e500
commit
8ff73f04db
|
@ -10,8 +10,16 @@ def doc(en_vocab):
|
|||
heads = [0, 0, 0]
|
||||
deps = ["ROOT", "dobj", "dobj"]
|
||||
ents = ["O", "B-ORG", "O"]
|
||||
morphs = ["Feat1=A", "Feat1=B", "Feat1=A|Feat2=D"]
|
||||
return Doc(
|
||||
en_vocab, words=words, pos=pos, tags=tags, heads=heads, deps=deps, ents=ents
|
||||
en_vocab,
|
||||
words=words,
|
||||
pos=pos,
|
||||
tags=tags,
|
||||
heads=heads,
|
||||
deps=deps,
|
||||
ents=ents,
|
||||
morphs=morphs,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1398,8 +1398,6 @@ cdef class Doc:
|
|||
attributes. Attribute values need to be JSON-serializable. Values will
|
||||
be added to an "_" key in the data, e.g. "_": {"foo": "bar"}.
|
||||
RETURNS (dict): The data in spaCy's JSON format.
|
||||
|
||||
DOCS: https://nightly.spacy.io/api/doc#to_json
|
||||
"""
|
||||
data = {"text": self.text}
|
||||
if self.has_annotation("ENT_IOB"):
|
||||
|
@ -1421,7 +1419,7 @@ cdef class Doc:
|
|||
if include_annotation["POS"]:
|
||||
token_data["pos"] = token.pos_
|
||||
if include_annotation["MORPH"]:
|
||||
token_data["morph"] = token.morph_
|
||||
token_data["morph"] = token.morph
|
||||
if include_annotation["LEMMA"]:
|
||||
token_data["lemma"] = token.lemma_
|
||||
if include_annotation["DEP"]:
|
||||
|
|
Loading…
Reference in New Issue
Block a user