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

PredefinedTextOpinionAnnotator -- Opinion Identifier Treated as Entity ID #514

Closed
Tracked by #488
nicolay-r opened this issue Aug 17, 2023 · 0 comments
Closed
Tracked by #488
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@nicolay-r
Copy link
Owner

nicolay-r commented Aug 17, 2023

Fix: rename the method to __convert_entity_id

In the code below, origin_id is related to Opinion id! Method name actually is wrong
#495 related

def __convert_opinion_id(news, origin_id, esp):
assert(isinstance(news, BratNews))
assert(isinstance(origin_id, int))
assert(isinstance(esp, BaseParsedNewsServiceProvider))
if not news.contains_entity(origin_id):
# Due to the complexity of entities, some entities might be nested.
# Therefore the latter, some entities might be discarded.
return None
origin_entity = news.get_entity_by_id(origin_id)
if not esp.contains_entity(origin_entity):
return None
document_entity = esp.get_document_entity(origin_entity)
return document_entity.IdInDocument

@nicolay-r nicolay-r added bug Something isn't working critical labels Aug 17, 2023
@nicolay-r nicolay-r self-assigned this Aug 17, 2023
@nicolay-r nicolay-r added documentation Improvements or additions to documentation and removed critical labels Aug 17, 2023
@nicolay-r nicolay-r mentioned this issue Aug 17, 2023
24 tasks
nicolay-r added a commit that referenced this issue Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant