中文

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

  1. GraphGen now supports HuggingFace Datasets as an input data source for data generation.

  2. GraphGen now supports VQA (Visual Question Answering) data generation.

  3. GraphGen has added support for community detection in knowledge graphs using the Leiden algorithm, which enables the synthesis of Chain-of-Thought (CoT) data.

  4. GraphGen has added Google, Bing, Wikipedia, and UniProt as search back-ends.

  5. GraphGen has knowledge graph evaluation metrics about accuracy (entity/relation), consistency (conflict detection), and structural robustness (noise, connectivity, degree distribution).

  6. GraphGen supports various LLM inference servers, API servers, inference clients, input file formats, data modalities, output data formats, and output data types.

  7. 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

  1. When running GraphGen from PyPI, the user installs GraphGen.

  2. When running GraphGen from PyPI, the user runs it in the CLI.

  3. When running GraphGen with Docker, the user builds the Docker image.

  4. When running GraphGen with Docker, the user runs the Docker container.

  5. When running GraphGen from source, the user picks the desired format and runs the matching script.

  6. When running GraphGen from source, the user gets the generated data.

  7. The preparation section of the GraphGen quick start includes a step in which the user clones the repository.

  8. The preparation section of the GraphGen quick start also includes a step in which the user creates a new uv environment.

  9. The preparation section of the GraphGen quick start has one more step in which the user configures the dependencies.

  10. When running GraphGen from source, the instructions include a step in which the user configures the environment.

  11. When running GraphGen from source, the instructions also include a step in which the user sets the environment variables listed there.

From the README · bash
   uv pip install graphg
From the README · bash
   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
From the README · bash
   ls cache/output
From the README · bash
   docker build -t graphgen .
From the README · bash
    docker run -p 7860:7860 graphgen

Sources

This page is written from the official sources below. Open them to check the original text.

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.