如何构建知识图谱?
How to build a knowledge graph?
我用 PageRank 制作了一个小型搜索引擎原型,它可以在我的电脑上运行。我有兴趣在其之上构建一个知识图谱,它应该 return 只查询在正确上下文中的网页,类似于 Google 找到搜索问题的相关答案的方式。我看到很多关于知识图谱的宣传,但文献不多,而且几乎没有像构建指南这样的伪代码。有谁知道有关此类知识图在内部如何工作的良好参考资料,因此无需创建关于 KG 的模型?
知识图谱是一个流行语。它是为实现某个结果而组合在一起的模型和技术的总和。
您旅程的第一站是 Natural language processing, Ontologies and Text mining. It is a wide field of artificial intelligence, go here 实地调查。
在构建自己的模型之前,我建议您使用专用工具箱(例如 gensim)尝试不同的标准算法。你将学习tf-idf、LDA、文档特征向量等
我假设您想使用文本数据,如果您想使用其他图像进行图像搜索,那就不同了。音频部分也一样。
构建模型只是第一步,Google 知识图最困难的部分是实际扩展到每天数十亿个请求...
可以在 Apache Spark、"the current-gen Hadoop" 之上构建良好的处理管道 "easily"。它提供了一个弹性的分布式数据存储,如果你想扩展,这是必需的。
如果您想将数据保存为图表,如在图论(如 pagerank)中那样,用于实时查询,我建议您使用 Bulbs,这是一个 "Like an ORM for graphs, but instead of SQL, you use the graph-traversal language Gremlin to query the database" 的框架。例如,您可以将后端从 Neo4j 切换到 OpenRDF(如果您做本体论,这很有用)。
对于图形分析,您可以使用 Spark,GraphX module or GraphLab。
希望对您有所帮助。
我知道我来晚了,但首先要澄清一些术语:知识图和 Ontology 很相似(我在语义 Web 范式中说话)。在语义 Web 堆栈中,基础是 RDF,它是一种将图形定义为三元组(主语、谓语、宾语)的语言。 RDFS 是 RDF 之上的一层。它定义了一个元模型,例如 rdf:type 等谓词和 rdfs:Class 等节点。尽管 RDFS 提供了一个元模型,但它没有逻辑基础,因此没有推理器可以验证模型或对其进行进一步推理。 RDFS 之上的层是 OWL(Web Ontology 语言)。它具有由描述逻辑定义的形式语义,描述逻辑是一阶逻辑的可判定子集。它有更多预定义的节点和链接,例如 owl:Class、owl:ObjectProperty 等。因此,当人们使用术语 ontology 时,他们通常指的是 OWL 模型。当他们使用知识图这个术语时,它可能指的是 OWL 中定义的 ontology(因为 OWL 最终仍然是一个 RDF 图)或者它可能只是 [=15= 中的一个图].
我说过,因为 IMO 构建知识图谱的最佳方法是定义一个 ontology,然后使用各种语义 Web 工具将数据(例如,从电子表格)加载到 ontology .开始使用 IMO 的最佳工具是 Protege ontology editor from Stanford. It's free and for a free open source tool very reliable and intuitive. And there is a good tutorial for how to use Protege and learn OWL as well as other Semantic Web tools such as SPARQL and SHACL. That tutorial can be found here: New Protege Pizza Tutorial (disclosure: that links to my site, I wrote the tutorial). If you want to get into the lower levels of the graph you probably want to check out a triplestore. It is a graph database designed for OWL and RDF models. The free version of Franz Inc's AllegroGraph triplestore is easy to use and supports 5M triples. Another good triplestore that is free and open source is part of the Apache Jena framework.
我用 PageRank 制作了一个小型搜索引擎原型,它可以在我的电脑上运行。我有兴趣在其之上构建一个知识图谱,它应该 return 只查询在正确上下文中的网页,类似于 Google 找到搜索问题的相关答案的方式。我看到很多关于知识图谱的宣传,但文献不多,而且几乎没有像构建指南这样的伪代码。有谁知道有关此类知识图在内部如何工作的良好参考资料,因此无需创建关于 KG 的模型?
知识图谱是一个流行语。它是为实现某个结果而组合在一起的模型和技术的总和。 您旅程的第一站是 Natural language processing, Ontologies and Text mining. It is a wide field of artificial intelligence, go here 实地调查。
在构建自己的模型之前,我建议您使用专用工具箱(例如 gensim)尝试不同的标准算法。你将学习tf-idf、LDA、文档特征向量等
我假设您想使用文本数据,如果您想使用其他图像进行图像搜索,那就不同了。音频部分也一样。
构建模型只是第一步,Google 知识图最困难的部分是实际扩展到每天数十亿个请求...
可以在 Apache Spark、"the current-gen Hadoop" 之上构建良好的处理管道 "easily"。它提供了一个弹性的分布式数据存储,如果你想扩展,这是必需的。
如果您想将数据保存为图表,如在图论(如 pagerank)中那样,用于实时查询,我建议您使用 Bulbs,这是一个 "Like an ORM for graphs, but instead of SQL, you use the graph-traversal language Gremlin to query the database" 的框架。例如,您可以将后端从 Neo4j 切换到 OpenRDF(如果您做本体论,这很有用)。
对于图形分析,您可以使用 Spark,GraphX module or GraphLab。
希望对您有所帮助。
我知道我来晚了,但首先要澄清一些术语:知识图和 Ontology 很相似(我在语义 Web 范式中说话)。在语义 Web 堆栈中,基础是 RDF,它是一种将图形定义为三元组(主语、谓语、宾语)的语言。 RDFS 是 RDF 之上的一层。它定义了一个元模型,例如 rdf:type 等谓词和 rdfs:Class 等节点。尽管 RDFS 提供了一个元模型,但它没有逻辑基础,因此没有推理器可以验证模型或对其进行进一步推理。 RDFS 之上的层是 OWL(Web Ontology 语言)。它具有由描述逻辑定义的形式语义,描述逻辑是一阶逻辑的可判定子集。它有更多预定义的节点和链接,例如 owl:Class、owl:ObjectProperty 等。因此,当人们使用术语 ontology 时,他们通常指的是 OWL 模型。当他们使用知识图这个术语时,它可能指的是 OWL 中定义的 ontology(因为 OWL 最终仍然是一个 RDF 图)或者它可能只是 [=15= 中的一个图].
我说过,因为 IMO 构建知识图谱的最佳方法是定义一个 ontology,然后使用各种语义 Web 工具将数据(例如,从电子表格)加载到 ontology .开始使用 IMO 的最佳工具是 Protege ontology editor from Stanford. It's free and for a free open source tool very reliable and intuitive. And there is a good tutorial for how to use Protege and learn OWL as well as other Semantic Web tools such as SPARQL and SHACL. That tutorial can be found here: New Protege Pizza Tutorial (disclosure: that links to my site, I wrote the tutorial). If you want to get into the lower levels of the graph you probably want to check out a triplestore. It is a graph database designed for OWL and RDF models. The free version of Franz Inc's AllegroGraph triplestore is easy to use and supports 5M triples. Another good triplestore that is free and open source is part of the Apache Jena framework.