You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugBugs and behaviour differing from documentationfeat / docFeature: Doc, Span and Token objectsfeat / serializeFeature: Serialization, saving and loading
Since pos attribute of tokens is now writable (related comment ), I ran into the issue that I changed the pos tag and serialized the doc but on deserializing, it retained the original pos tag.
I believe this is happening because only the tag attributes are pickled
import spacy
nlp = spacy.load('en')
d = nlp("displaCy uses JavaScript, SVG and CSS to show you how computers understand language")
print(d[0].pos_) # prints ADJ
d[0].pos_ = "NOUN"
d.to_disk("t.txt")
d2 = nlp("")
d2.from_disk("t.txt")
print(d2[0].pos_) # prints ADJ
Wasn't entirely sure if this should be a bug or a feature request to make pos tags picklable or maybe documentation could be added specifying how serializing would not save changes in coarse grained attributes with pos tag as examples
Your Environment
spaCy version: 2.1.3
Platform: Ubuntu-14.04-trusty
Python version: 3.6.8
Models: en_core_web_lg, en, en_core_web_md
The text was updated successfully, but these errors were encountered:
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
lockbot
locked as resolved and limited conversation to collaborators
Sep 19, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugBugs and behaviour differing from documentationfeat / docFeature: Doc, Span and Token objectsfeat / serializeFeature: Serialization, saving and loading
How to reproduce the behaviour
Since
pos
attribute of tokens is now writable (related comment ), I ran into the issue that I changed the pos tag and serialized the doc but on deserializing, it retained the original pos tag.I believe this is happening because only the
tag
attributes are pickledWasn't entirely sure if this should be a bug or a feature request to make pos tags picklable or maybe documentation could be added specifying how serializing would not save changes in coarse grained attributes with pos tag as examples
Your Environment
The text was updated successfully, but these errors were encountered: