Skip to content

implement confidence=True for relation_extraction - #27

Open
rafmacalaba wants to merge 1 commit into
fastino-ai:mainfrom
rafmacalaba:main
Open

implement confidence=True for relation_extraction#27
rafmacalaba wants to merge 1 commit into
fastino-ai:mainfrom
rafmacalaba:main

Conversation

@rafmacalaba

Copy link
Copy Markdown

include_confidence=True not working on relation_extraction.

results = extractor.extract_relations(
     "John works for Apple Inc. Mary works for Google.",
     ["works_for"],
    format_results=True,
    include_confidence=True
)
output is
{'relation_extraction': {'works_for': [('John', 'Apple Inc.'),
   ('Mary', 'Google')]}}

After the implementation
Desired Output

{'relation_extraction': {'works_for': [(('John', 0.999244213104248, 0, 1), ('Apple Inc.', 0.9919405579566956, 3, 6)), (('Mary', 0.9999995231628418, 6, 7), ('Google', 0.9999977350234985, 9, 10))]}}

it is also adhering to the format of the entities so this update is much more necessary.

@rafmacalaba

Copy link
Copy Markdown
Author

@urchade for your review!

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

Successfully merging this pull request may close these issues.

1 participant