javeme commented on code in PR #27:
URL: 
https://github.com/apache/incubator-hugegraph-ai/pull/27#discussion_r1462843409


##########
hugegraph-llm/examples/build_kg_test.py:
##########
@@ -40,9 +31,12 @@
         " their distinctive digital presence through their respective 
webpages, showcasing their"
         " varied interests and experiences."
     )
-    builder = KgBuilder(default_llm)
+    builder = KgConstructionTask(default_llm)

Review Comment:
   seems KgBuilder is more concise



##########
hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/commit_to_hugegraph.py:
##########
@@ -186,3 +189,40 @@ def run(self, data: dict):
         relationships_schemas = generate_relationships(new_relationships)
         for relationship in relationships_schemas:
             exec(relationship)
+
+
+class CommitSPOToKg:

Review Comment:
   CommitSpoToKg?



##########
hugegraph-llm/examples/build_kg_test.py:
##########
@@ -40,9 +31,12 @@
         " their distinctive digital presence through their respective 
webpages, showcasing their"
         " varied interests and experiences."
     )
-    builder = KgBuilder(default_llm)
+    builder = KgConstructionTask(default_llm)
+
+    # spo triple extract
+    
builder.spo_triple_extract(TEXT).print_result().commit_to_hugegraph(spo=True).run()

Review Comment:
   prefer do_something style like extract_spo?



##########
hugegraph-llm/examples/build_kg_test.py:
##########
@@ -40,9 +31,12 @@
         " their distinctive digital presence through their respective 
webpages, showcasing their"
         " varied interests and experiences."
     )
-    builder = KgBuilder(default_llm)
+    builder = KgConstructionTask(default_llm)
+
+    # spo triple extract
+    
builder.spo_triple_extract(TEXT).print_result().commit_to_hugegraph(spo=True).run()
     # build kg with only text
-    
builder.parse_text_to_data(TEXT).disambiguate_data().commit_data_to_kg().run()
+    
builder.info_extract(TEXT).word_sense_disambiguation().commit_to_hugegraph().run()

Review Comment:
   try this style?
   ```
   extract_nodes_relationships
   disambiguate_word_sense
   ```



##########
hugegraph-llm/src/hugegraph_llm/operators/common_op/print_result.py:
##########
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+from typing import Any
+
+
+class PrintResult:
+    def __init__(self):
+        self.result = None
+
+    def run(self, data: Any) -> Any:
+        self.result = data
+        print(self.result)
+        return self.result
+
+    def print_result(self):

Review Comment:
   unused method?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to