You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "Thespica (via GitHub)" <gi...@apache.org> on 2025/04/17 14:21:02 UTC
[I] [Bug] describe the main problem [incubator-hugegraph-ai]
Thespica opened a new issue, #210:
URL: https://github.com/apache/incubator-hugegraph-ai/issues/210
### Bug Type (问题类型)
others (please comment below)
### Before submit
- [x] I had searched in the [issues](https://github.com/apache/incubator-hugegraph-ai/issues) and found no similar issues.
### Environment (环境信息)
- Server Version: v1.5.0
- Toolchain Version: v1.5.0
- Data Size: xx vertices, xx edges <!-- (like 1000W 点,9000W 边) -->>
### Expected & Actual behavior (期望与实际表现)
When I run the demo, clicking the `extract graph data` and finding that LLMs have generated the right json but the final output missed edges like:
```
{
"vertices": [
{
"id": "1:Sarah",
"label": "person",
"type": "vertex",
"properties": {
"name": "Sarah",
"age": "30",
"occupation": "attorney"
}
},
{
"id": "1:James",
"label": "person",
"type": "vertex",
"properties": {
"name": "James",
"occupation": "journalist"
}
},
{
"id": "2:www.sarahsplace.com",
"label": "webpage",
"type": "vertex",
"properties": {
"name": "www.sarahsplace.com",
"url": "www.sarahsplace.com"
}
},
{
"id": "2:JamesWebpage",
"label": "webpage",
"type": "vertex",
"properties": {
"name": "JamesWebpage"
}
}
],
"edges": []
}
```
part of output of qwen-max(code block was generated by LLMs):
```
{
"vertices": [
{
"id": "1:Sarah",
"label": "person",
"type": "vertex",
"properties": {
"name": "Sarah",
"age": "30",
"occupation": "attorney"
}
},
{
"id": "1:James",
"label": "person",
"type": "vertex",
"properties": {
"name": "James",
"occupation": "journalist"
}
},
{
"id": "2:www.sarahsplace.com",
"label": "webpage",
"type": "vertex",
"properties": {
"name": "www.sarahsplace.com",
"url": "www.sarahsplace.com"
}
},
{
"id": "2:JamesWebpage",
"label": "webpage",
"type": "vertex",
"properties": {
"name": "JamesWebpage"
}
}
],
"edges": [
{
"id": 1,
"label": "roommate",
"type": "edge",
"outV": "1:Sarah",
"outVLabel": "person",
"inV": "1:James",
"inVLabel": "person",
"properties": {
"date": "2010"
}
},
{
"id": 2,
"label": "link",
"type": "edge",
"outV": "2:www.sarahsplace.com",
"outVLabel": "webpage",
"inV": "1:Sarah",
"inVLabel": "person",
"properties": {}
},
{
"id": 3,
"label": "link",
"type": "edge",
"outV": "2:JamesWebpage",
"outVLabel": "webpage",
"inV": "1:James",
"inVLabel": "person",
"properties": {}
}
]
}
```
I found it that #187 had changed the format of json given in prompt, mean while haven't change the regex to extract json generated by LLMs by the format of json given in prompt.
### Vertex/Edge example (问题点 / 边数据举例)
```javascript
same as demo
```
### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
```javascript
same as demo
```
--
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: dev-unsubscribe@hugegraph.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Regex extraction not fit json format of prompt [incubator-hugegraph-ai]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #210:
URL: https://github.com/apache/incubator-hugegraph-ai/issues/210#issuecomment-2813114089
<!-- Answer -->
The issue you're experiencing with missing edges in the final output of the demo is likely due to the regex pattern used for extracting JSON data. The regex pattern `r'(\[.*?])'` might not be robust enough to handle the JSON structures generated by LLMs, especially if there have been changes in the JSON format as mentioned in issue #187. This could result in incomplete extraction of edges from the JSON <sup>[[1]](https://github.com/apache/incubator-hugegraph-ai/blob/main/hugegraph-llm/src/hugegraph_llm/operators/llm_op/property_graph_extract.py)</sup>.
To resolve this, you may need to update the regex pattern to better match the current JSON structure generated by the LLMs.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/0d0ec880-6ce4-4736-b90f-2e9274391c08?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/0d0ec880-6ce4-4736-b90f-2e9274391c08?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/0d0ec880-6ce4-4736-b90f-2e9274391c08?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/0d0ec880-6ce4-4736-b90f-2e9274391c08?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0d0ec880-6ce4-4736-b90f-2e9274391c08?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/0d0ec880-6ce4-4736-b90f-2e9274391c08?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0d0ec880-6ce4-4736-b90f-2e9274391c08?feedback_type=other)</sup>
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] [Bug] Regex extraction not fit json format of prompt [incubator-hugegraph-ai]
Posted by "Thespica (via GitHub)" <gi...@apache.org>.
Thespica commented on issue #210:
URL: https://github.com/apache/incubator-hugegraph-ai/issues/210#issuecomment-2829255025
resolved by #211
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] [Bug] Regex extraction not fit json format of prompt [incubator-hugegraph-ai]
Posted by "Thespica (via GitHub)" <gi...@apache.org>.
Thespica closed issue #210: [Bug] Regex extraction not fit json format of prompt
URL: https://github.com/apache/incubator-hugegraph-ai/issues/210
--
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: dev-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org