知识图谱RAG查询引擎¶
图谱RAG¶
图谱RAG是一种基于知识的RAG方法,用于从给定任务的知识图谱中检索信息。通常,这是为了构建基于与任务相关的实体子图的上下文。
基于GraphStore的RAG vs 基于VectorStore的RAG¶
正如我们在这个教程中比较了Graph RAG在某些用例中的帮助,显示知识图谱作为信息的唯一格式可以缓解由“分割和嵌入”RAG方法的性质引起的几个问题。
为什么使用知识图谱RAG查询引擎¶
在Llama Index中,有两种情景可以应用图谱RAG:
- 使用Llama Index从文档构建知识图谱,使用LLM甚至本地模型,为此,我们应该选择
KnowledgeGraphIndex
。 - 利用现有的知识图谱,在这种情况下,我们应该使用
KnowledgeGraphRAGQueryEngine
。
注意,在Llama Index中与知识图谱相关的第三个查询引擎是
NL2GraphQuery
或Text2Cypher
,无论是现有的知识图谱还是不是,都可以使用KnowledgeGraphQueryEngine
来完成。
在开始Knowledge Graph RAG QueryEngine
演示之前,让我们先为Llama Index的基本准备工作做好准备。
如果您在colab上打开这个笔记本,您可能需要安装LlamaIndex 🦙。
%pip install llama-index-llms-azure-openai
%pip install llama-index-graph-stores-nebula
%pip install llama-index-llms-openai
%pip install llama-index-embeddings-azure-openai
!pip install llama-index
OpenAI 是一个人工智能研究实验室,致力于推动人工智能的发展,以确保它对人类的利益产生积极影响。OpenAI 的使命是确保人工智能技术的发展符合人类的价值观,并能够为全人类带来长期利益。
# 为OpenAIimport osos.environ["OPENAI_API_KEY"] = "sk-..."import loggingimport syslogging.basicConfig( stream=sys.stdout, level=logging.INFO) # logging.DEBUG 用于更详细的输出# 定义LLMfrom llama_index.llms.openai import OpenAIfrom llama_index.core import SettingsSettings.llm = OpenAI(temperature=0, model="gpt-3.5-turbo")Settings.chunk_size = 512
Azure是由微软提供的云计算服务,用于构建、测试、部署和管理应用程序和服务。Azure提供了各种服务,包括计算、存储和数据库,可以帮助用户在全球范围内扩展其业务。Azure还提供了人工智能、物联网和区块链等先进的解决方案,以满足不同行业和业务的需求。
from llama_index.llms.azure_openai import AzureOpenAIfrom llama_index.embeddings.azure_openai import AzureOpenAIEmbedding# 对于Azure OpenAIapi_key = "<api-key>"azure_endpoint = "https://<your-resource-name>.openai.azure.com/"api_version = "2023-07-01-preview"llm = AzureOpenAI( model="gpt-35-turbo-16k", deployment_name="my-custom-llm", api_key=api_key, azure_endpoint=azure_endpoint, api_version=api_version,)# 您需要部署自己的嵌入模型以及自己的聊天完成模型embed_model = AzureOpenAIEmbedding( model="text-embedding-ada-002", deployment_name="my-custom-embedding", api_key=api_key, azure_endpoint=azure_endpoint, api_version=api_version,)
from llama_index.core import Settings
Settings.llm = llm
Settings.embed_model = embed_model
Settings.chunk_size = 512
准备NebulaGraph¶
在这个演示中,我们以NebulaGraphStore为例,因此在进行下一步对现有知识图谱执行图RAG之前,让我们确保我们有一个运行中的NebulaGraph,并且已定义了数据模式。
这一步安装了NebulaGraph的客户端,并准备了定义NebulaGraph图空间的上下文。
# 使用以下命令创建一个 NebulaGraph(版本3.5.0或更新版本)集群:# 选项0:适用于使用Docker的机器:`curl -fsSL nebula-up.siwei.io/install.sh | bash`# 选项1:适用于桌面版:NebulaGraph Docker扩展 https://hub.docker.com/extensions/weygu/nebulagraph-dd-ext# 如果不是使用上述方法创建,可以使用以下命令从NebulaGraph的控制台创建:# CREATE SPACE llamaindex(vid_type=FIXED_STRING(256), partition_num=1, replica_factor=1);# :sleep 10;# USE llamaindex;# CREATE TAG entity(name string);# CREATE EDGE relationship(relationship string);# :sleep 10;# CREATE TAG INDEX entity_index ON entity(name(256));%pip install ipython-ngql nebula3-pythonos.environ["NEBULA_USER"] = "root"os.environ["NEBULA_PASSWORD"] = "nebula" # 默认为"nebula"os.environ[ "NEBULA_ADDRESS"] = "127.0.0.1:9669" # 假设NebulaGraph已在本地安装space_name = "llamaindex"edge_types, rel_prop_names = ["relationship"], [ "relationship"] # 默认值,如果从空的kg创建,则可以省略tags = ["entity"] # 默认值,如果从空的kg创建,则可以省略
Requirement already satisfied: ipython-ngql in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (0.5)
Requirement already satisfied: nebula3-python in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (3.4.0)
Requirement already satisfied: Jinja2 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from ipython-ngql) (3.1.2)
Requirement already satisfied: pandas in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from ipython-ngql) (2.0.3)
Requirement already satisfied: httplib2>=0.20.0 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from nebula3-python) (0.22.0)
Requirement already satisfied: six>=1.16.0 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from nebula3-python) (1.16.0)
Requirement already satisfied: pytz>=2021.1 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from nebula3-python) (2023.3)
Requirement already satisfied: future>=0.18.0 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from nebula3-python) (0.18.3)
Requirement already satisfied: pyparsing!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3,<4,>=2.4.2 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from httplib2>=0.20.0->nebula3-python) (3.0.9)
Requirement already satisfied: MarkupSafe>=2.0 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from Jinja2->ipython-ngql) (2.1.3)
Requirement already satisfied: numpy>=1.20.3 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from pandas->ipython-ngql) (1.25.2)
Requirement already satisfied: tzdata>=2022.1 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from pandas->ipython-ngql) (2023.3)
Requirement already satisfied: python-dateutil>=2.8.2 in /Users/loganmarkewich/llama_index/llama-index/lib/python3.9/site-packages (from pandas->ipython-ngql) (2.8.2)
WARNING: You are using pip version 21.2.4; however, version 23.2.1 is available.
You should consider upgrading via the '/Users/loganmarkewich/llama_index/llama-index/bin/python -m pip install --upgrade pip' command.
Note: you may need to restart the kernel to use updated packages.
然后,我们可以实例化一个 NebulaGraphStore
,以便将 StorageContext
的 graph_store
创建为它。
from llama_index.core import StorageContext
from llama_index.graph_stores.nebula import NebulaGraphStore
graph_store = NebulaGraphStore(
space_name=space_name,
edge_types=edge_types,
rel_prop_names=rel_prop_names,
tags=tags,
)
storage_context = StorageContext.from_defaults(graph_store=graph_store)
这里,我们假设使用了与此教程相同的知识图。
执行图形RAG查询¶
最后,让我们演示如何针对现有的知识图执行图形RAG。
我们所需要做的就是使用RetrieverQueryEngine
,并将其检索器配置为KnowledgeGraphRAGRetriever
。
KnowledgeGraphRAGRetriever
执行以下步骤:
- 搜索问题/任务的相关实体
- 从知识图中获取这些实体的子图(默认为2层深度)
- 基于子图构建上下文
请注意,搜索相关实体的方式可以是基于关键词提取或嵌入式的,这由KnowledgeGraphRAGRetriever
的retriever_mode
参数控制,支持的选项包括:
- "keyword"
- "embedding"(尚未实现)
- "keyword_embedding"(尚未实现)
以下是如何使用RetrieverQueryEngine
和KnowledgeGraphRAGRetriever
的示例:
from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index.core.retrievers import KnowledgeGraphRAGRetriever
graph_rag_retriever = KnowledgeGraphRAGRetriever(
storage_context=storage_context,
verbose=True,
)
query_engine = RetrieverQueryEngine.from_args(
graph_rag_retriever,
)
然后我们可以像这样查询它:
from IPython.display import display, Markdown
response = query_engine.query(
"Tell me about Peter Quill?",
)
display(Markdown(f"<b>{response}</b>"))
Entities processed: ['Star', 'Lord', 'Marvel', 'Quill', 'Galaxy', 'Guardians', 'Guardians of the Galaxy', 'Star-Lord', 'Peter Quill', 'Peter'] Entities processed: ['Star', 'Lord', 'Marvel', 'Quill', 'Galaxy', 'Guardians', 'Guardians of the Galaxy', 'Star-Lord', 'Peter Quill', 'Peter'] Graph RAG context: The following are knowledge sequence in max depth 2 in the form of `subject predicate, object, predicate_next_hop, object_next_hop ...` extracted based on key entities as subject: Guardians, is member of, Guardians, was experimented on, by the High Evolutionary Guardians, is member of, Guardians, considered to tell, origins Guardians, is member of, Guardians, origins, team-up movie Guardians, is member of, Guardians, befriended, his fellow Batch 89 test subjects Guardians, is member of, Guardians, sought to enhance and anthropomorphize animal lifeforms, to create an ideal society Guardians, is member of, Guardians, is creator of, Rocket Guardians, is member of, Guardians, is, Mantis Guardians, is member of, Guardians, is half-sister of, Mantis Guardians, is member of, Guardians, is, Kraglin Guardians, is member of, Guardians, developed psionic abilities, after being abandoned in outer space Guardians, is member of, Guardians, would portray, Cosmo Guardians, is member of, Guardians, recalls, his past Guardians, is member of, Guardians Guardians, is member of, Guardians, focus on, third Guardians-centric film Guardians, is member of, Guardians, is, Rocket Guardians, is member of, Guardians, backstory, flashbacks Guardians, is member of, Guardians, is former second-in-command of, Ravagers Quill, is half-sister of, Mantis, is member of, Guardians Quill, is half-sister of, Mantis, is, Mantis Quill, is in a state of depression, following the appearance of a variant of his dead lover Gamora Quill, is half-sister of, Mantis Peter Quill, is leader of, Guardians of the Galaxy, is sequel to, Guardians of the Galaxy Peter Quill, was raised by, a group of alien thieves and smugglers Peter Quill, would return to the MCU, May 2021 Peter Quill, is leader of, Guardians of the Galaxy Peter Quill, is half-human, half-Celestial Peter Quill, was abducted from Earth, as a child Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, released in, Dolby Cinema Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, released on, Disney+ Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, is sequel to, Guardians of the Galaxy Vol. 2
Peter Quill is the leader of the Guardians of the Galaxy and the main protagonist of the Guardians of the Galaxy films. He was raised by a group of alien thieves and smugglers, and was abducted from Earth as a child. He is half-human, half-Celestial, and has the ability to wield an energy weapon called the Infinity Stone. He is set to return to the MCU in May 2021.
response = await query_engine.aquery(
"Tell me about Peter Quill?",
)
display(Markdown(f"<b>{response}</b>"))
INFO:openai:message='OpenAI API response' path=https://api.openai.com/v1/completions processing_ms=611 request_id=1c07a89e18f19ac7bbc508507c2902d9 response_code=200 Entities processed: ['Star', 'Lord', 'Marvel', 'Quill', 'Galaxy', 'Guardians', 'Guardians of the Galaxy', 'Star-Lord', 'Peter Quill', 'Peter'] INFO:openai:message='OpenAI API response' path=https://api.openai.com/v1/completions processing_ms=992 request_id=6517cb63da3364acd33e816a9b3ee242 response_code=200 Entities processed: ['Star', 'Lord', 'Marvel', 'Quill', 'Galaxy', 'Guardians', 'Guardians of the Galaxy', 'Star-Lord', 'Peter Quill', 'Peter'] Graph RAG context: The following are knowledge sequence in max depth 2 in the form of `subject predicate, object, predicate_next_hop, object_next_hop ...` extracted based on key entities as subject: Guardians, is member of, Guardians, was experimented on, by the High Evolutionary Guardians, is member of, Guardians, considered to tell, origins Guardians, is member of, Guardians, origins, team-up movie Guardians, is member of, Guardians, befriended, his fellow Batch 89 test subjects Guardians, is member of, Guardians, sought to enhance and anthropomorphize animal lifeforms, to create an ideal society Guardians, is member of, Guardians, is creator of, Rocket Guardians, is member of, Guardians, is, Mantis Guardians, is member of, Guardians, is half-sister of, Mantis Guardians, is member of, Guardians, is, Kraglin Guardians, is member of, Guardians, developed psionic abilities, after being abandoned in outer space Guardians, is member of, Guardians, would portray, Cosmo Guardians, is member of, Guardians, recalls, his past Guardians, is member of, Guardians Guardians, is member of, Guardians, focus on, third Guardians-centric film Guardians, is member of, Guardians, is, Rocket Guardians, is member of, Guardians, backstory, flashbacks Guardians, is member of, Guardians, is former second-in-command of, Ravagers Quill, is half-sister of, Mantis, is member of, Guardians Quill, is half-sister of, Mantis, is, Mantis Quill, is in a state of depression, following the appearance of a variant of his dead lover Gamora Quill, is half-sister of, Mantis Peter Quill, is leader of, Guardians of the Galaxy, is sequel to, Guardians of the Galaxy Peter Quill, was raised by, a group of alien thieves and smugglers Peter Quill, would return to the MCU, May 2021 Peter Quill, is leader of, Guardians of the Galaxy Peter Quill, is half-human, half-Celestial Peter Quill, was abducted from Earth, as a child Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, released in, Dolby Cinema Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, released on, Disney+ Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, is sequel to, Guardians of the Galaxy Vol. 2 INFO:openai:message='OpenAI API response' path=https://api.openai.com/v1/completions processing_ms=2384 request_id=b5a7e601affa751fbc7f957f3359a238 response_code=200
Peter Quill is the leader of the Guardians of the Galaxy and the main protagonist of the Guardians of the Galaxy films. He was raised by a group of alien thieves and smugglers, and was abducted from Earth as a child. He is half-human, half-Celestial, and has the ability to wield an energy weapon called the Infinity Stone. He is set to return to the MCU in May 2021.
将nl2graphquery作为图RAG中的上下文包含¶
(Sub)Graph RAG和nl2graphquery的性质是不同的。并不是说其中一个比另一个更好,而是当一个更适合某种类型的问题时。要了解它们之间的区别,可以查看此演示来比较它们。
在实际情况下,我们可能并不总是知道哪种方法更有效,因此,在RAG中最好利用知识图谱的方法是获取检索结果作为上下文,并让LLM + Prompt生成答案,使其都参与其中。
因此,我们可以选择从知识图谱中检索到的两个上下文片段中综合生成答案:
- Graph RAG,默认的检索方法,提取与问题中的关键实体相关的子图。
- NL2GraphQuery,基于查询和知识图谱的模式生成知识图谱查询,默认情况下是关闭状态。
我们可以设置with_nl2graphquery=True
来启用它,例如:
graph_rag_retriever_with_nl2graphquery = KnowledgeGraphRAGRetriever(
storage_context=storage_context,
verbose=True,
with_nl2graphquery=True,
)
query_engine_with_nl2graphquery = RetrieverQueryEngine.from_args(
graph_rag_retriever_with_nl2graphquery,
)
response = query_engine_with_nl2graphquery.query(
"What do you know about Peter Quill?",
)
display(Markdown(f"<b>{response}</b>"))
Graph Store Query: ``` MATCH (p:`entity`)-[:`relationship`]->(m:`entity`) WHERE p.`entity`.`name` == 'Peter Quill' RETURN m.`entity`.`name`; ``` Graph Store Response: {'m.entity.name': ['May 2021', 'as a child', 'Guardians of the Galaxy', 'a group of alien thieves and smugglers', 'half-Celestial']} Entities processed: ['Star', 'Lord', 'Marvel', 'Quill', 'Galaxy', 'Guardians', 'Guardians of the Galaxy', 'Star-Lord', 'Peter Quill', 'Peter'] Entities processed: ['Star', 'Lord', 'Marvel', 'Quill', 'Galaxy', 'Guardians', 'Guardians of the Galaxy', 'Star-Lord', 'Peter Quill', 'Peter'] Graph RAG context: The following are knowledge sequence in max depth 2 in the form of `subject predicate, object, predicate_next_hop, object_next_hop ...` extracted based on key entities as subject: Guardians, is member of, Guardians, was experimented on, by the High Evolutionary Guardians, is member of, Guardians, considered to tell, origins Guardians, is member of, Guardians, origins, team-up movie Guardians, is member of, Guardians, befriended, his fellow Batch 89 test subjects Guardians, is member of, Guardians, sought to enhance and anthropomorphize animal lifeforms, to create an ideal society Guardians, is member of, Guardians, is creator of, Rocket Guardians, is member of, Guardians, is, Mantis Guardians, is member of, Guardians, is half-sister of, Mantis Guardians, is member of, Guardians, is, Kraglin Guardians, is member of, Guardians, developed psionic abilities, after being abandoned in outer space Guardians, is member of, Guardians, would portray, Cosmo Guardians, is member of, Guardians, recalls, his past Guardians, is member of, Guardians Guardians, is member of, Guardians, focus on, third Guardians-centric film Guardians, is member of, Guardians, is, Rocket Guardians, is member of, Guardians, backstory, flashbacks Guardians, is member of, Guardians, is former second-in-command of, Ravagers Quill, is half-sister of, Mantis, is member of, Guardians Quill, is half-sister of, Mantis, is, Mantis Quill, is in a state of depression, following the appearance of a variant of his dead lover Gamora Quill, is half-sister of, Mantis Peter Quill, is leader of, Guardians of the Galaxy, is sequel to, Guardians of the Galaxy Peter Quill, was raised by, a group of alien thieves and smugglers Peter Quill, would return to the MCU, May 2021 Peter Quill, is leader of, Guardians of the Galaxy Peter Quill, is half-human, half-Celestial Peter Quill, was abducted from Earth, as a child Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, released in, Dolby Cinema Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, released on, Disney+ Guardians of the Galaxy, is sequel to, Guardians of the Galaxy, is sequel to, Guardians of the Galaxy Vol. 2
Peter Quill is the leader of the Guardians of the Galaxy and was abducted from Earth as a child. He is half-human and half-Celestial, and was raised by a group of alien thieves and smugglers. He would return to the MCU in May 2021.
让我们检查响应的元数据,以了解通过检查response.metadata
检索Graph RAG与nl2graphquery的更多细节。
- text2Cypher,它生成一个Cypher查询,以回答上下文。
Graph Store Query: MATCH (e:`entity`)-[r:`relationship`]->(e2:`entity`)
WHERE e.`entity`.`name` == 'Peter Quill'
RETURN e2.`entity`.`name`
SubGraph RAG,它获取'Peter Quill'的子图以构建上下文。
最后,它结合了上下文的两个节点,以综合回答。
import pprint
pp = pprint.PrettyPrinter()
pp.pprint(response.metadata)
{'46faf6d6-8a71-44c8-ae81-794e71a62fbc': {'graph_schema': 'Node properties: ' "[{'tag': 'entity', " "'properties': " "[('name', " "'string')]}]\n" 'Edge properties: ' "[{'edge': " "'relationship', " "'properties': " "[('relationship', " "'string')]}]\n" 'Relationships: ' "['(:entity)-[:relationship]->(:entity)']\n", 'graph_store_query': '```\n' 'MATCH ' '(p:`entity`)-[:`relationship`]->(m:`entity`) ' 'WHERE ' 'p.`entity`.`name` ' "== 'Peter " "Quill'\n" 'RETURN ' 'm.`entity`.`name`;\n' '```', 'graph_store_response': {'m.entity.name': ['May ' '2021', 'as ' 'a ' 'child', 'Guardians ' 'of ' 'the ' 'Galaxy', 'a ' 'group ' 'of ' 'alien ' 'thieves ' 'and ' 'smugglers', 'half-Celestial']}, 'query_str': 'What do you know about ' 'Peter Quill?'}, 'def19bbf-d8ac-43b2-a121-675748cc9454': {'kg_rel_map': {'Guardians': ['Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'was ' 'experimented ' 'on, by ' 'the ' 'High ' 'Evolutionary', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'considered ' 'to ' 'tell, ' 'origins', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'origins, ' 'team-up ' 'movie', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'befriended, ' 'his ' 'fellow ' 'Batch ' '89 ' 'test ' 'subjects', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'sought ' 'to ' 'enhance ' 'and ' 'anthropomorphize ' 'animal ' 'lifeforms, ' 'to ' 'create ' 'an ' 'ideal ' 'society', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'is ' 'creator ' 'of, ' 'Rocket', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'is, ' 'Mantis', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'is ' 'half-sister ' 'of, ' 'Mantis', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'is, ' 'Kraglin', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'developed ' 'psionic ' 'abilities, ' 'after ' 'being ' 'abandoned ' 'in ' 'outer ' 'space', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'would ' 'portray, ' 'Cosmo', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'recalls, ' 'his ' 'past', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'focus ' 'on, ' 'third ' 'Guardians-centric ' 'film', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'is, ' 'Rocket', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'backstory, ' 'flashbacks', 'Guardians, ' 'is ' 'member ' 'of, ' 'Guardians, ' 'is ' 'former ' 'second-in-command ' 'of, ' 'Ravagers'], 'Guardians of the Galaxy': ['Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'in, ' 'Dolby ' 'Cinema', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'on, ' 'Disney+', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy ' 'Vol. ' '2', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'in, ' '3D', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'in, ' '4DX', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'grossed, ' '$32 ' 'million ' 'in ' 'its ' 'third ' 'weekend', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'leader ' 'of, ' 'Guardians ' 'of ' 'the ' 'Galaxy', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'in, ' 'Guardians ' 'of ' 'the ' 'Galaxy ' 'Vol. ' '3', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'wrote ' 'and ' 'directed, ' 'Guardians ' 'of ' 'the ' 'Galaxy ' 'Vol. ' '3', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is, ' 'American ' 'superhero ' 'film', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'grossed, ' '$845.4 ' 'million', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'was ' 'fired ' 'from, ' 'Guardians ' 'of ' 'the ' 'Galaxy ' 'Vol. ' '3', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'leader ' 'of, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'was ' 'abducted ' 'from ' 'Earth, ' 'as ' 'a ' 'child', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'grossed, ' '$359 ' 'million ' 'in ' 'the ' 'United ' 'States ' 'and ' 'Canada', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'on, ' 'digital ' 'download', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'in, ' 'IMAX', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'leader ' 'of, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'half-human, ' 'half-Celestial', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'leader ' 'of, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'was ' 'raised ' 'by, ' 'a ' 'group ' 'of ' 'alien ' 'thieves ' 'and ' 'smugglers', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'screened ' 'at, ' 'Dongdaemun ' 'Design ' 'Plaza', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'in, ' 'ScreenX', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'leader ' 'of, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'would ' 'return ' 'to ' 'the ' 'MCU, ' 'May ' '2021', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'grossed, ' '$486.4 ' 'million ' 'in ' 'other ' 'territories', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'on, ' 'Ultra ' 'HD ' 'Blu-ray', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'on, ' 'DVD', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'grossed, ' '$92 ' 'million ' 'for ' 'a ' 'drop ' 'of ' '40% ' 'from ' 'its ' 'opening ' 'weekend', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'premiered ' 'at, ' 'Disneyland ' 'Paris', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'released ' 'on, ' 'Blu-ray', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'could ' 'happen, ' 'April ' '2017', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'made, ' '$48.2 ' 'million ' 'on ' 'its ' 'first ' 'day', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'grossed, ' '$168.1 ' 'million ' 'in ' 'its ' 'opening ' 'weekend', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'debuted ' 'with, ' '$118.4 ' 'million', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'would ' 'likely ' 'center ' 'on, ' 'new ' 'group ' 'of ' 'characters', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'retained ' 'the ' 'top ' 'spot ' 'at ' 'the ' 'box ' 'office ' 'with, ' '$62 ' 'million', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'be ' 'his ' 'last ' 'Guardians ' 'film, ' 'September ' '2019', 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'nominated ' 'for, ' 'Best ' 'Picture'], 'Marvel': ['Marvel, ' 'was fired ' 'from, ' 'Marvel, ' 'stated, ' 'that in ' 'addition ' 'to having ' 'the ' 'basic ' 'story ' 'for ' 'Guardians ' 'of the ' 'Galaxy ' 'Vol.2 ' '(2017) ' 'while ' 'working ' 'on the ' 'first ' 'film', 'Marvel, ' 'was fired ' 'from, ' 'Marvel, ' 'was ' 'unsure, ' 'if he ' 'would be ' 'involved ' 'with a ' 'third ' 'Guardians ' 'film', 'Marvel, ' 'was fired ' 'from, ' 'Marvel, ' 'was ' 'privately ' 'notified ' 'by, Horn', 'Marvel, ' 'was fired ' 'from, ' 'Marvel, ' 'was fired ' 'from, ' 'Guardians ' 'of the ' 'Galaxy ' 'Vol. 3', 'Marvel, ' 'was fired ' 'from, ' 'Marvel', 'Marvel, ' 'was fired ' 'from, ' 'Marvel, ' 'wrote and ' 'directed, ' 'Guardians ' 'of the ' 'Galaxy ' 'Vol. 3', 'Marvel, ' 'was fired ' 'from, ' 'Marvel, ' 'was fired ' 'from, ' 'Disney', 'Marvel, ' 'was fired ' 'from, ' 'Marvel, ' 'could ' 'return as ' 'director ' 'for, ' 'Vol.3'], 'Peter Quill': ['Peter ' 'Quill, ' 'is ' 'leader ' 'of, ' 'Guardians ' 'of ' 'the ' 'Galaxy, ' 'is ' 'sequel ' 'to, ' 'Guardians ' 'of ' 'the ' 'Galaxy', 'Peter ' 'Quill, ' 'was ' 'raised ' 'by, ' 'a ' 'group ' 'of ' 'alien ' 'thieves ' 'and ' 'smugglers', 'Peter ' 'Quill, ' 'would ' 'return ' 'to ' 'the ' 'MCU, ' 'May ' '2021', 'Peter ' 'Quill, ' 'is ' 'leader ' 'of, ' 'Guardians ' 'of ' 'the ' 'Galaxy', 'Peter ' 'Quill, ' 'is ' 'half-human, ' 'half-Celestial', 'Peter ' 'Quill, ' 'was ' 'abducted ' 'from ' 'Earth, ' 'as a ' 'child'], 'Quill': ['Quill, is ' 'half-sister ' 'of, ' 'Mantis, is ' 'member of, ' 'Guardians', 'Quill, is ' 'half-sister ' 'of, ' 'Mantis, ' 'is, Mantis', 'Quill, is ' 'in a state ' 'of ' 'depression, ' 'following ' 'the ' 'appearance ' 'of a ' 'variant of ' 'his dead ' 'lover ' 'Gamora', 'Quill, is ' 'half-sister ' 'of, ' 'Mantis']}, 'kg_rel_text': ['Guardians, is ' 'member of, ' 'Guardians, was ' 'experimented on, by ' 'the High ' 'Evolutionary', 'Guardians, is ' 'member of, ' 'Guardians, ' 'considered to tell, ' 'origins', 'Guardians, is ' 'member of, ' 'Guardians, origins, ' 'team-up movie', 'Guardians, is ' 'member of, ' 'Guardians, ' 'befriended, his ' 'fellow Batch 89 ' 'test subjects', 'Guardians, is ' 'member of, ' 'Guardians, sought ' 'to enhance and ' 'anthropomorphize ' 'animal lifeforms, ' 'to create an ideal ' 'society', 'Guardians, is ' 'member of, ' 'Guardians, is ' 'creator of, Rocket', 'Guardians, is ' 'member of, ' 'Guardians, is, ' 'Mantis', 'Guardians, is ' 'member of, ' 'Guardians, is ' 'half-sister of, ' 'Mantis', 'Guardians, is ' 'member of, ' 'Guardians, is, ' 'Kraglin', 'Guardians, is ' 'member of, ' 'Guardians, ' 'developed psionic ' 'abilities, after ' 'being abandoned in ' 'outer space', 'Guardians, is ' 'member of, ' 'Guardians, would ' 'portray, Cosmo', 'Guardians, is ' 'member of, ' 'Guardians, recalls, ' 'his past', 'Guardians, is ' 'member of, ' 'Guardians', 'Guardians, is ' 'member of, ' 'Guardians, focus ' 'on, third ' 'Guardians-centric ' 'film', 'Guardians, is ' 'member of, ' 'Guardians, is, ' 'Rocket', 'Guardians, is ' 'member of, ' 'Guardians, ' 'backstory, ' 'flashbacks', 'Guardians, is ' 'member of, ' 'Guardians, is ' 'former ' 'second-in-command ' 'of, Ravagers', 'Quill, is ' 'half-sister of, ' 'Mantis, is member ' 'of, Guardians', 'Quill, is ' 'half-sister of, ' 'Mantis, is, Mantis', 'Quill, is in a ' 'state of ' 'depression, ' 'following the ' 'appearance of a ' 'variant of his dead ' 'lover Gamora', 'Quill, is ' 'half-sister of, ' 'Mantis', 'Peter Quill, is ' 'leader of, ' 'Guardians of the ' 'Galaxy, is sequel ' 'to, Guardians of ' 'the Galaxy', 'Peter Quill, was ' 'raised by, a group ' 'of alien thieves ' 'and smugglers', 'Peter Quill, would ' 'return to the MCU, ' 'May 2021', 'Peter Quill, is ' 'leader of, ' 'Guardians of the ' 'Galaxy', 'Peter Quill, is ' 'half-human, ' 'half-Celestial', 'Peter Quill, was ' 'abducted from ' 'Earth, as a child', 'Guardians of the ' 'Galaxy, is sequel ' 'to, Guardians of ' 'the Galaxy, ' 'released in, Dolby ' 'Cinema', 'Guardians of the ' 'Galaxy, is sequel ' 'to, Guardians of ' 'the Galaxy, ' 'released on, ' 'Disney+', 'Guardians of the ' 'Galaxy, is sequel ' 'to, Guardians of ' 'the Galaxy, is ' 'sequel to, ' 'Guardians of the ' 'Galaxy Vol. 2']}}