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
In the "Make example predictions" section of Notebook 09, the spaCy API has changed slightly:
fromspacy.lang.enimportEnglishnlp=English() # setup English sentence parser# New (.add_pipe() only instead of .create_pipe()) sentencizer=nlp.add_pipe("sentencizer") # create sentence splitting pipeline object
Old:
fromspacy.lang.enimportEnglishnlp=English() # setup English sentence parser# Old version of spaCysentencizer=nlp.create_pipe("sentencizer") # create sentence splitting pipeline object nlp.add_pipe(sentencizer) # add sentence splitting pipeline object to sentence parser
Full code (as of May 2023):
# Create sentencizer - Source: https://spacy.io/usage/linguistic-features#sbd fromspacy.lang.enimportEnglishnlp=English() # setup English sentence parser# New version of spaCysentencizer=nlp.add_pipe("sentencizer") # create sentence splitting pipeline object# Create "doc" of parsed sequences, change index for a different abstractdoc=nlp(example_abstracts[0]["abstract"])
abstract_lines= [str(sent) forsentinlist(doc.sents)] # return detected sentences from doc in string type (not spaCy token type)# View the abstract linesabstract_lines
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
A list of updates for different TensorFlow API changes as well as spaCy API changes to Notebook 09: Milestone Project 2: SkimLit 📄🔥
TextVectorization
API updateAs of TensorFlow 2.6+,
TextVectorization
is out of experimental and available viatf.keras.layers.TextVectorization
:New (TensorFlow 2.6+):
Old:
Functionality remains the same.
spaCy
sentencizer
API updateIn the "Make example predictions" section of Notebook 09, the spaCy API has changed slightly:
Old:
Full code (as of May 2023):
Beta Was this translation helpful? Give feedback.
All reactions