MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / __init__

Method __init__

bmtools/knowledge/knowledge_extraction.py:24–39  ·  view source on GitHub ↗
(self, file_path, topk=3, keyword_matching_func=bm25)

Source from the content-addressed store, hash-verified

22class KnowledgeExtraction():
23
24 def __init__(self, file_path, topk=3, keyword_matching_func=bm25):
25
26 # select an attribute in the jsons to embed
27 self.names = {"matched_attr": "cause_name"}
28 self.cause_name = self.names["matched_attr"]
29
30 nltk.download('stopwords')
31 nltk.download('punkt')
32 nltk.download('averaged_perceptron_tagger')
33 nltk.download('wordnet')
34 self.wnl = WordNetLemmatizer()
35 self.keyword_matching_func = keyword_matching_func
36
37 self.topk = topk
38
39 self.corpus, self.preprocessed_corpus, self.matched_attr, self.stop_words = self.knowledge_load(file_path)
40
41 def knowledge_load(self, file_path):
42

Callers

nothing calls this directly

Calls 1

knowledge_loadMethod · 0.95

Tested by

no test coverage detected