Skip to content
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

language #25

Closed
2260383858 opened this issue Nov 23, 2024 · 2 comments
Closed

language #25

2260383858 opened this issue Nov 23, 2024 · 2 comments
Labels
question Further information is requested

Comments

@2260383858
Copy link

Can Chinese be supported?

@lairgiyassir lairgiyassir added the question Further information is requested label Nov 25, 2024
@lairgiyassir
Copy link
Collaborator

Hello,

To the best of my knowledge, I think yes! it is possible :)

Here is the output


kg = itext2kg_openai.build_graph(sections=['iText2KG 是一个 Python 包,旨在利用大型语言模型(LLM)从文本文档中提取实体和关系,逐步构建一致的知识图谱。'], ent_threshold=0.7, rel_threshold=0.7)
----
[INFO] ------- Extracting Entities from the Document 1
{'entities': [{'name': 'iText2KG', 'label': 'Python Package'}, {'name': 'Large Language Model', 'label': 'Technology'}, {'name': 'Text Documents', 'label': 'Data Source'}, {'name': 'Entities', 'label': 'Concept'}, {'name': 'Relationships', 'label': 'Concept'}, {'name': 'Knowledge Graph', 'label': 'Data Structure'}]}
[INFO] ------- Extracting Relations from the Document 1
{'relationships': [{'startNode': {'name': 'itext2kg', 'label': 'Python_Package'}, 'endNode': {'name': 'text documents', 'label': 'Data_Source'}, 'name': 'extracts from'}, {'startNode': {'name': 'itext2kg', 'label': 'Python_Package'}, 'endNode': {'name': 'entities', 'label': 'Concept'}, 'name': 'extracts'}, {'startNode': {'name': 'itext2kg', 'label': 'Python_Package'}, 'endNode': {'name': 'relationships', 'label': 'Concept'}, 'name': 'extracts'}, {'startNode': {'name': 'itext2kg', 'label': 'Python_Package'}, 'endNode': {'name': 'knowledge graph', 'label': 'Data_Structure'}, 'name': 'builds'}, {'startNode': {'name': 'itext2kg', 'label': 'Python_Package'}, 'endNode': {'name': 'large language model', 'label': 'Technology'}, 'name': 'utilizes'}]}
[INFO] Verification of invented entities

If you want the output in Chinese, you need to prompt the LLM in Chinese (fork this repo ;))

@2260383858
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants