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

Correct the code in example #1

Open
hienvuhuy opened this issue Apr 28, 2024 · 0 comments
Open

Correct the code in example #1

hienvuhuy opened this issue Apr 28, 2024 · 0 comments

Comments

@hienvuhuy
Copy link

Many thanks for your repo. It works pretty well for my task. However, there is a minor error on your demo code. If readers simply follow your code. There should be an error:

create_mentions(doc, rules_analyzer)
Traceback (most recent call last):
File "", line 1, in
File "/work/huyhien-v/Experiments/Project/fr-coref/coreferee_french/build_mentions.py", line 92, in create_mentions
rules_analyzer = nlp.get_pipe("coreferee").annotator.rules_analyzer
AttributeError: 'LanguageSpecificRulesAnalyzer' object has no attribute 'get_pipe'

It should be create_mention(doc, nlp), and in

for chain in doc._.coref_chains:
... for mention in chain:
... heads = [doc[i] for i in mention.token_indexes]
... mention_phrase = build_mention(heads, rules_analyzer)
... print(heads, '->', mention_phrase)

It should be mention_phrase = build_mention(heads, nlp)

Hope it saves time for others 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant