Skip to content

Commit

Permalink
resolvede empty coref issues #3
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidFromPandora committed Mar 31, 2022
1 parent 4b3cb1c commit 29faf81
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ dmypy.json
.pyre/
/models
*.tar.gz
/crosslingual_coreference/models
/crosslingual_coreference/models
test.py
3 changes: 2 additions & 1 deletion crosslingual_coreference/CrossLingualPredictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def predict(self, text: str, advanced_resolve: bool = True) -> dict:

# Passing a document with no coreferences returns its original form
if not clusters:
return text
prediction['resolved_text'] = text
return prediction

doc = self.predictor._spacy(text)

Expand Down
1 change: 0 additions & 1 deletion crosslingual_coreference/examples/test_spacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

nlp = spacy.load('nl_core_news_sm')

nlp.remove_pipe('xx_coref')
nlp.add_pipe('xx_coref', config={"model_name": "xlm_roberta"})

for doc in nlp.pipe(texts):
Expand Down

0 comments on commit 29faf81

Please sign in to comment.