df1dd9b108f3cd7d5130e7f654ea099021c7a2b3,qanta/guesser/experimental/elasticsearch_instance_of.py,ElasticSearchIndex,search,#ElasticSearchIndex#Any#Any#Any#Any#,82
Before Change
.query(
"multi_match",
query=text,
fields=["wiki_content", "qb_content"]
)
else:
s = Search(index=INDEX_NAME) \
.query(
"multi_match",
query=text,
fields=["wiki_content", "qb_content"]
)
results = s.execute()
return [(r.page, r.meta.score) for r in results]
es_index = ElasticSearchIndex()
After Change
class_to_i = {label: i for i, label in enumerate(classes, 1)}
i_to_class = {i: label for label, i in class_to_i.items()}
for q, p in zip(questions, pages):
for sent in q:
x_data.append(sent)
if p in instance_of_map:
y_data.append(class_to_i[instance_of_map[p]])
else:
y_data.append(class_to_i[NO_MATCH])
return x_data, y_data, i_to_class, class_to_i
class ElasticSearchWikidataGuesser(AbstractGuesser):
def __init__(self):
super().__init__()
self.class_to_i = None
self.i_to_class = None
self.instance_of_model = None
guesser_conf = conf["guessers"]["ESWikidata"]
self.confidence_threshold = guesser_conf["confidence_threshold"]
self.normalize_score_by_length = guesser_conf["normalize_score_by_length"]
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 8
Instances
Project Name: Pinafore/qb
Commit Name: df1dd9b108f3cd7d5130e7f654ea099021c7a2b3
Time: 2017-05-24
Author: ski.rodriguez@gmail.com
File Name: qanta/guesser/experimental/elasticsearch_instance_of.py
Class Name: ElasticSearchIndex
Method Name: search
Project Name: open-mmlab/mmdetection
Commit Name: 62b8ae9006d4cbb05e10f66e61d3f161b3409a49
Time: 2021-02-04
Author: dave.andersen@gmail.com
File Name: mmdet/apis/inference.py
Class Name:
Method Name: inference_detector
Project Name: etal/cnvkit
Commit Name: 203ed6d1fda8de579c2bf311e5890dca05c14985
Time: 2016-12-10
Author: eric.talevich@gmail.com
File Name: cnvlib/target.py
Class Name:
Method Name: shorten_labels
Project Name: explosion/thinc
Commit Name: afc71e321e8e849d27e9d3b2f053c9ead11fd171
Time: 2017-02-04
Author: honnibal@gmail.com
File Name: thinc/neural/vecs2vec.py
Class Name: MeanPooling
Method Name: predict