GH-3686: show actual dictionary name when custom dict is passed to EntityMentionLinker#3695
Open
haoyu-haoyu wants to merge 1 commit intoflairNLP:masterfrom
Open
GH-3686: show actual dictionary name when custom dict is passed to EntityMentionLinker#3695haoyu-haoyu wants to merge 1 commit intoflairNLP:masterfrom
haoyu-haoyu wants to merge 1 commit intoflairNLP:masterfrom
Conversation
…ed to EntityMentionLinker When a pre-built dictionary is passed directly via the dictionary= param, dictionary_name_or_path is never assigned so the log message prints "Dictionary None". Fall back to dictionary.database_name (which InMemoryEntityLinkingDictionary sets from the dataset_name arg).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When you pass a pre-built
InMemoryEntityLinkingDictionarydirectly toEntityMentionLinker.build()viadictionary=, the log message printsDictionary Nonebecausedictionary_name_or_pathis never assigned in that code path.This was a bit confusing when following Tutorial 4 — took me a while to figure out why predict() seemed to work but returned nothing.
The fix falls back to
dictionary.database_name(whichInMemoryEntityLinkingDictionaryinherits fromEntityLinkingDictionary) before defaulting to"custom".Closes #3686