Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chigwell/eknowledge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

PyPI version License: MIT Downloads LinkedIn

eknowledge

eknowledge is a Python package designed to facilitate the generation of knowledge graphs from textual inputs. It leverages language models to parse text and extract relationships between entities, organizing these relationships into a structured graph format. This tool is ideal for developers, researchers, and anyone interested in structured knowledge extraction from unstructured text.

Installation

Install eknowledge using pip:

pip install eknowledge langchain_llm7

Usage

Here's a simple example to get you started with eknowledge. This example demonstrates how to generate a knowledge graph from a given text input using the package.

Example

from eknowledge import execute_graph_generation
from langchain_llm7 import ChatLLM7
# Initialize the language model
MODEL = "deepseek-r1"
llm = ChatLLM7(model=MODEL)
# Define your input text
input_text = "The quick brown fox jumps over the lazy dog."
# Generate the graph
graph = execute_graph_generation(
 text=input_text,
 llm=llm,
 chunk_size=100,
 verbose=True
)
# Output the graph
print(graph)
# > Splitting text into 1 chunks of size 100 words.
# > Processing chunk 1/1...
# > Nodes successfully processed in chunk 1/1.
# > [{'from': 'quick brown fox', 'relationship': 'interacts_with', 'to': 'lazy dog'}]

This script will output a knowledge graph based on the relationships identified in the text.

Contributing

Contributions are welcome! Please open issues or submit pull requests for any bugs, features, or improvements you would like to see.

License

eknowledge is MIT licensed, as found in the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /