Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix small grammatical errors with coref_resolved #332

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions neuralcoref/neuralcoref.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,12 @@ def get_resolved(doc, clusters):
resolved = list(tok.text_with_ws for tok in doc)
for cluster in clusters:
for coref in cluster:
if coref != cluster.main:
resolved[coref.start] = cluster.main.text + doc[coref.end-1].whitespace_
for i in range(coref.start+1, coref.end):
resolved[i] = ""
if coref != cluster.main and get_span_type(cluster.main) != MENTION_TYPE["PRONOMINAL"]:
has_det = any(tok.pos_ == 'DET' for tok in coref)
if not has_det:
resolved[coref.start] = cluster.main.text + doc[coref.end-1].whitespace_
for i in range(coref.start+1, coref.end):
resolved[i] = ""
return ''.join(resolved)

#################################################
Expand Down