コード例 #1
0
    def __init__(self, relations_file, mongo_url, mongo_port, db_name, entity_relation_file, label_file):
        client = MongoClient(mongo_url, mongo_port)
        self.db = client[db_name]
        self.db.nell.ensure_index("relation")
        # Entity to label strings
        self.entity_to_label_map = {}

        BaseGraphBuilder.__init__(self, "NELL", relations_file, entity_relation_file, label_file)
コード例 #2
0
 def __init__(self, relations_file, sparql_endpoint, graph_file, noun_phrase_file):
     self.sparql_client = SPARQLWrapper(sparql_endpoint, returnFormat=JSON)
     BaseGraphBuilder.__init__(self, "freebase", relations_file, graph_file, noun_phrase_file)
コード例 #3
0
 def __init__(self, relations_file, sparql_endpoint, graph_file, noun_phrase_file):
     self.sparql_client = SPARQLWrapper(sparql_endpoint, returnFormat=JSON)
     self.sparql_client.method = 'POST'
     self.relations_file = relations_file
     BaseGraphBuilder.__init__(self, "yago", relations_file, graph_file, noun_phrase_file)