GraphGen: Knowledge Graph-Guided Synthetic Data Framework
GraphGen is a framework for synthetic data generation guided by knowledge graphs.
Verified
Core facts
Read by a script from the official API, not rewritten by a model.
- License
- Apache-2.0
- Languages
- Python
- Maintainer
- InternScience
- Verified
What it is
GraphGen is a framework for synthetic data generation guided by knowledge graphs. GraphGen begins by constructing a fine-grained knowledge graph from the source text, then identifies knowledge gaps in LLMs using the expected calibration error metric, and prioritizes generating QA pairs that target high-value, long-tail knowledge. GraphGen also incorporates multi-hop neighborhood sampling to capture complex relational information and employs style-controlled generation to diversify the resulting QA data. The project has released the initial version of GraphGen.
Main features
GraphGen now supports HuggingFace Datasets as an input data source for data generation.
GraphGen now supports VQA (Visual Question Answering) data generation.
GraphGen has added support for community detection in knowledge graphs using the Leiden algorithm, which enables the synthesis of Chain-of-Thought (CoT) data.
GraphGen has added Google, Bing, Wikipedia, and UniProt as search back-ends.
GraphGen has knowledge graph evaluation metrics about accuracy (entity/relation), consistency (conflict detection), and structural robustness (noise, connectivity, degree distribution).
GraphGen supports various LLM inference servers, API servers, inference clients, input file formats, data modalities, output data formats, and output data types.
According to the GraphGen support list, users can flexibly configure the framework according to the needs of the synthetic data that they want to produce.
Getting started
When running GraphGen from PyPI, the user installs GraphGen.
When running GraphGen from PyPI, the user runs it in the CLI.
When running GraphGen with Docker, the user builds the Docker image.
When running GraphGen with Docker, the user runs the Docker container.
When running GraphGen from source, the user picks the desired format and runs the matching script.
When running GraphGen from source, the user gets the generated data.
The preparation section of the GraphGen quick start includes a step in which the user clones the repository.
The preparation section of the GraphGen quick start also includes a step in which the user creates a new uv environment.
The preparation section of the GraphGen quick start has one more step in which the user configures the dependencies.
When running GraphGen from source, the instructions include a step in which the user configures the environment.
When running GraphGen from source, the instructions also include a step in which the user sets the environment variables listed there.
uv pip install graphg SYNTHESIZER_MODEL=your_synthesizer_model_name \
SYNTHESIZER_BASE_URL=your_base_url_for_synthesizer_model \
SYNTHESIZER_API_KEY=your_api_key_for_synthesizer_model \
TRAINEE_MODEL=your_trainee_model_name \
TRAINEE_BASE_URL=your_base_url_for_trainee_model \
TRAINEE_API_KEY=your_api_key_for_trainee_model \
graphg --output_dir cache ls cache/output docker build -t graphgen . docker run -p 7860:7860 graphgenSources
This page is written from the official sources below. Open them to check the original text.
- GitHub READMEhttps://github.com/InternScience/GraphGenFetched
Verified ·
This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.