-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add llm wenxinyiyan & config util & spo_triple_extract #27
Conversation
@imbajin @lzyxx77 @liuxiaocs7 PTAL, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me, left some minor comments
wenxinyiyan
could be replaced withERNIE
orERNIE-Bot
?
because: https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu and more international (at this point CC: @imbajin)- There are many automatic formatting modifications in this pr. could we add corresponding commands in the readme or other locations to stay code style unified.
hugegraph-llm/src/hugegraph_llm/operators/kg_construction_task.py
Outdated
Show resolved
Hide resolved
we need to manually fix all the warnings mentioned below before commit! " | ||
export PYTHONPATH=${ROOT_DIR}/hugegraph-llm/src:${ROOT_DIR}/hugegraph-python-client/src | ||
pylint --rcfile=${ROOT_DIR}/style/pylint.conf ${ROOT_DIR}/hugegraph-llm | ||
#pylint --rcfile=${ROOT_DIR}/style/pylint.conf ${ROOT_DIR}/hugegraph-python-client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix hugegraph-python-client code style in next pr
hugegraph-llm/src/hugegraph_llm/operators/llm_op/info_extract.py
Outdated
Show resolved
Hide resolved
hugegraph-llm/src/hugegraph_llm/operators/llm_op/info_extract.py
Outdated
Show resolved
Hide resolved
hugegraph-llm/src/hugegraph_llm/operators/llm_op/info_extract.py
Outdated
Show resolved
Hide resolved
hugegraph-llm/src/hugegraph_llm/operators/llm_op/info_extract.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
hugegraph-llm/src/hugegraph_llm/operators/common_op/print_result.py
Outdated
Show resolved
Hide resolved
hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/commit_to_hugegraph.py
Outdated
Show resolved
Hide resolved
return """You are a data scientist working for a company that is building a graph database. | ||
Your task is to extract information from data and convert it into a graph database. Provide a | ||
set of Nodes in the form [ENTITY_ID, TYPE, PROPERTIES] and a set of relationships in the form | ||
[ENTITY_ID_1, RELATIONSHIP, ENTITY_ID_2, PROPERTIES] and a set of NodesSchemas in the form [ | ||
ENTITY_TYPE, PRIMARY_KEY, PROPERTIES] and a set of RelationshipsSchemas in the form [ | ||
ENTITY_TYPE_1, RELATIONSHIP, ENTITY_TYPE_2, PROPERTIES] It is important that the ENTITY_ID_1 | ||
and ENTITY_ID_2 exists as nodes with a matching ENTITY_ID. If you can't pair a relationship | ||
with a pair of nodes don't add it. When you find a node or relationship you want to add try | ||
to create a generic TYPE for it that describes the entity you can also think of it as a label. | ||
|
||
Here is an example The input you will be given: Data: Alice lawyer and is 25 years old and Bob | ||
is her roommate since 2001. Bob works as a journalist. Alice owns a the webpage www.alice.com | ||
and Bob owns the webpage www.bob.com. The output you need to provide: Nodes: ["Alice", "Person", | ||
{"age": 25, "occupation": "lawyer", "name": "Alice"}], ["Bob", "Person", {"occupation": | ||
"journalist", "name": "Bob"}], ["alice.com", "Webpage", {"name": "alice.com", | ||
"url": "www.alice.com"}], ["bob.com", "Webpage", {"name": "bob.com", "url": "www.bob.com"}] | ||
Relationships: [{"Person": "Alice"}, "roommate", {"Person": "Bob"}, {"start": 2021}], | ||
[{"Person": "Alice"}, "owns", {"Webpage": "alice.com"}, {}], [{"Person": "Bob"}, "owns", | ||
{"Webpage": "bob.com"}, {}] NodesSchemas: ["Person", "name", {"age": "int", | ||
"name": "text", "occupation": | ||
"text"}], ["Webpage", "name", {"name": "text", "url": "text"}] RelationshipsSchemas :["Person", | ||
"roommate", "Person", {"start": "int"}], ["Person", "owns", "Webpage", {}]""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a better way to maintain the default prompt if we make subsequent modifications and adjustments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
spo triple extraction