-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
77 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
Empty file.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,14 +45,15 @@ def slide_sentences(sentences, window_size=2): | |
return valid_html_df[['reference_id', 'url', 'nlp_sentences', 'nlp_sentences_slide_2']] | ||
|
||
class EvidenceSelector: | ||
def __init__(self): | ||
def __init__(self, sentence_retrieval=None, verb_module=None): | ||
self.logger = logging.getLogger(__name__) | ||
self.endpoint_url = "https://query.wikidata.org/sparql" | ||
self.headers = { | ||
'User-Agent': 'Mozilla/5.0 (compatible; MyBot/1.0; mailto:[email protected])' | ||
} | ||
self.verb_module = VerbModule() | ||
self.sentence_retrieval = SentenceRetrievalModule(max_len=512) | ||
# Use provided models or create new ones | ||
self.verb_module = verb_module or VerbModule() | ||
self.sentence_retrieval = sentence_retrieval or SentenceRetrievalModule(max_len=512) | ||
self.top_k = 5 | ||
|
||
def get_labels_from_sparql(self, property_ids: List[str], entity_ids: List[str]) -> Tuple[Dict[str, str], Dict[str, str]]: | ||
|