安装阶段:
- Vorbereitung der Umwelt:Python 3.8+和PyTorch 1.13.1+(建议CUDA 11.7 GPU环境)
- Einrichtung::
pip install graphg
(PyPI安装)
vielleichtgit clone
源码后pip install -r requirements.txt
- API-Konfiguration:在.env文件设置SYNTHESIZER_MODEL等关键参数
Operative Prozesse:
- Vorbereiten auf den Eintritt:制作符合要求的JSONL格式文本文件(参考resources/examples)
- Konfigurationsparameter:编辑graphgen_config.yaml设置采样深度、生成风格等
- Generation der Ausführung::
Befehlszeilenmethode:python -m graphg --config configs/graphgen_config.yaml
或通过python webui/app.py
启动Gradio可视化界面 - 获取输出:在output_dir指定目录查看生成的JSONL格式问答对
caveat:首次运行需5-10分钟初始化知识图谱;GPU设备可加速多跳关系处理;建议从demo数据开始验证环境。
Diese Antwort stammt aus dem ArtikelGraphGen: Feinabstimmung von Sprachmodellen mithilfe von Wissensgraphen zur Erzeugung synthetischer DatenDie