Skip to content

Commit

Permalink
Merge pull request #5 from frenkvdberg/master
Browse files Browse the repository at this point in the history
add neural quote attribution classifier
  • Loading branch information
andreasvc authored Jul 22, 2022
2 parents d1e83d7 + 0a96399 commit 4c34c9a
Show file tree
Hide file tree
Showing 2 changed files with 463 additions and 2 deletions.
7 changes: 5 additions & 2 deletions coref.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,9 @@ def resolvecoreference(trees, ngdata, gadata, mentions=None, clusters=None,
# gadata.get(mention.head.get('lemma', '').replace('_', '')),
)
speakeridentification(mentions, quotations, idx, doc)
if 'quote' in neural:
import qaclassifier
qaclassifier.predictions(trees, embeddings, quotations, mentions, idx)
if goldclusters:
return mentions, clusters, quotations, idx
stringmatch(mentions, clusters)
Expand Down Expand Up @@ -2469,8 +2472,8 @@ def sonar(ngdata, gadata, goldmentions, goldclusters, neural, subset='dev'):

def getcmdlines(neural):
"""Collect command line options used for training neural modules."""
cmdlines = {'span': 'mentionspanclassif.txt',
'feat': 'mentionfeatclassif.txt', 'pron': 'pronounmodel.txt'}
cmdlines = {'span': 'mentionspanclassif.txt','feat': 'mentionfeatclassif.txt',
'pron': 'pronounmodel.txt', 'quote': 'quote.txt'}
result = []
for a in neural:
try:
Expand Down
Loading

0 comments on commit 4c34c9a

Please sign in to comment.