Skip to main content

src for kst_instruct_following

Project description

指令跟随

医疗营销套电模型的目的是通过与患者在问诊的过程中建立信任,并在合理的时机索取患者联系方式,以期后续人工介入营销的机器人。

然而,目前的机器人指令跟随能力较差,包括符合人类偏好的通用指令以及不同需求方的特殊指令。提升指令跟随能力对机器人的套电成功率的提高具有很大的潜力,如:适应对话套路和流程、提高对话延续性、避免潜在纠纷风险等等。

建议服务器

192.168.1.67 [66服务器上可能由部分代码不是最新版]

指令跟随项目


/data/daixl/RL_study/instruct_following_project

-- dataset/ # 存放了儿科、眼科、妇产科的数据
-- instruction_cluster_dict.json #存放从 约束_new.xlsx 转换的json格式
-- logs/ # 保存vllm和grpo采样回复和打分
-- output/ # 存放模型训练checkpoint
-- save_models/ # 存放训练好的模型
-- script/ # 存放训练脚本
-- src/ # 存放主要代码
-- data_process/
    -- Config.py # 为按轮次随机构造策略和指令
    -- instruction_constructor.py # 将 约束_new.xlsx 
        # 转换为instruction_cluster_dict.json
    -- standard_datasets.py # 通过原始数据生成sft dpo grpo的数据 
        # 以及带指令约束的数据
    -- instruction_follow_creator.py # 针对带指令约束的数据采样-打分
        # 对应的completion[还需要优化,因为并不是所有的回复都满足指令(脏数据)]
-- template/ # 存放不同的prompt模板
-- processor.py # 为不同的数据预处理函数
-- sft_training.py 为sft训练代码
-- grpo_training.py 为grpo训练代码
-- grpo_rewarder.py 为Rewarder类
-- vllm-functions.py 为Rewarder采样以及其他采样生成回复时的调用函数
-- reward_model_trianing.py 为reward model 训练代码,未完善
-- vllms/ #存放vllm接口脚本,

自动化测试

/data/daixl/RL_study/deployment

分别为妇产科以及眼科的自动化测试脚本, 自行修改structure_data.py下的Dialog类的dialog_to_str_dxl函数以修改模型输入


外部数据集

/data/daixl/RL_study/dataset

也等价于

/data/public/data/Med_datasets/extra_format_datasets

zhongpei记录

  • 数据鼻祖(没有经过任何处理的数据)

    • /data3/zhongp/instruct_following_project/dataset/yk/raw/yk_train.jsonl
  • 数据流程:

    1. yk_train.jsonl
    2. yk_train_rewrite.jsonl:由yk_train.jsonl改写而来
    3. yk_sft_train_if.jsonl
  • 代码流程:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kst_instruct_following-0.2.0.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kst_instruct_following-0.2.0-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file kst_instruct_following-0.2.0.tar.gz.

File metadata

  • Download URL: kst_instruct_following-0.2.0.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for kst_instruct_following-0.2.0.tar.gz
Algorithm Hash digest
SHA256 84f38f1221dda8562f84d1a85eac049934633e9db987b535cbd3e47dfc21db7d
MD5 a195bebd70f668e9da66685e776d8569
BLAKE2b-256 afd97462140f4874fc28a02c6bc2622d5538b08eaea96987f0a5e3f9358f9b4e

See more details on using hashes here.

File details

Details for the file kst_instruct_following-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kst_instruct_following-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bca866296c4f1da02585fd7fcd63002ba498f96f3e9b22370cdfd7782265ab75
MD5 da80447a53dc70cb4eeb69a82a172e25
BLAKE2b-256 ab660866b0bf67f06c6ac17403b3c866ae752631520e3216b1bda2a9b92e1f4a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page