future will be built",      'is the ground on which')]Querying the graph‚ÄãWe can now use the graph QA chain to ask question of the graphfrom langchain.chains import GraphQAChainchain = GraphQAChain.from_llm(OpenAI(temperature=0), graph=graph, verbose=True)chain.run("what is Intel going to build?")            > Entering new GraphQAChain chain...    Entities Extracted:     Intel    Full Context:    Intel is going to build $20 billion semiconductor "mega site"    Intel is building state-of-the-art factories    Intel is creating 10,000 new good-paying jobs    Intel is helping build Silicon Valley        > Finished chain.    ' Intel is going to build a $20 billion semiconductor "mega site" with state-of-the-art factories, creating 10,000 new good-paying jobs and helping to build Silicon Valley.'Save the graph‚ÄãWe can also save and load the graph.graph.write_to_gml("graph.gml")from langchain.indexes.graph import NetworkxEntityGraphloaded_graph = NetworkxEntityGraph.from_gml("graph.gml")loaded_graph.get_triples()    [('Intel', '$20 billion semiconductor "mega site"', 'is going to build'),     ('Intel', 'state-of-the-art factories', 'is building'),     ('Intel', '10,000 new good-paying jobs', 'is creating'),     ('Intel', 'Silicon Valley', 'is helping build'),     ('Field of dreams',      "America's future will be built",      'is the ground on which')]PreviousNebulaGraphQAChainNextGraphSparqlQAChainCreate the graphQuerying the graphSave the graphCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
This notebook goes over how to do question answering over a graph data structure.
This notebook goes over how to do question answering over a graph data structure. ->: future will be built",      'is the ground on which')]Querying the graph‚ÄãWe can now use the graph QA chain to ask question of the graphfrom langchain.chains import GraphQAChainchain = GraphQAChain.from_llm(OpenAI(temperature=0), graph=graph, verbose=True)chain.run("what is Intel going to build?")            > Entering new GraphQAChain chain...    Entities Extracted:     Intel    Full Context:    Intel is going to build $20 billion semiconductor "mega site"    Intel is building state-of-the-art factories    Intel is creating 10,000 new good-paying jobs    Intel is helping build Silicon Valley        > Finished chain.    ' Intel is going to build a $20 billion semiconductor "mega site" with state-of-the-art factories, creating 10,000 new good-paying jobs and helping to build Silicon Valley.'Save the graph‚ÄãWe can also save and load the graph.graph.write_to_gml("graph.gml")from langchain.indexes.graph import NetworkxEntityGraphloaded_graph = NetworkxEntityGraph.from_gml("graph.gml")loaded_graph.get_triples()    [('Intel', '$20 billion semiconductor "mega site"', 'is going to build'),     ('Intel', 'state-of-the-art factories', 'is building'),     ('Intel', '10,000 new good-paying jobs', 'is creating'),     ('Intel', 'Silicon Valley', 'is helping build'),     ('Field of dreams',      "America's future will be built",      'is the ground on which')]PreviousNebulaGraphQAChainNextGraphSparqlQAChainCreate the graphQuerying the graphSave the graphCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.