Git Product home page Git Product logo

code_nlp's Introduction

项目 README 文件介绍:

本项目是自然语言处理课程作业项目,旨在通过修改提示词文件来提升模型性能。项目包含三个子任务:情绪分析(emotion)、分词(tokenization)、和翻译(translation)。每个子任务都有一个主运行脚本、提示词文件和环境需求文件。同学们需要关注于修改prompt文件中的提示语,以提升模型的输出性能。以下是项目的详细介绍和使用说明:

文件结构

├── emotion
│   ├── emotion.py (主运行脚本)
│   ├── prompt (提示词文件)
│   └── requirement.txt (环境依赖文件)
├── tokenization
│   ├── tokenization.py (主运行脚本)
│   ├── prompt (提示词文件)
│   ├── pku_training.utf8 (数据集)
│   └── requirement.txt (环境依赖文件)
└── translation
    ├── translation.py (主运行脚本)
    ├── prompt (提示词文件)
    ├── news-commentary-v13.zh-en.en (英语翻译数据集)
    ├── news-commentary-v13.zh-en.zh (中文翻译数据集)
    └── requirement.txt (环境依赖文件)

环境配置

  1. 将Python包源设置为清华源,以加速包的安装速度:
    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    
  2. 根据各子任务的requirement.txt文件安装所需的Python包。例如:
    pip install -r requirement.txt
    

任务执行步骤

请同学们按如下步骤处理每个任务,需要注意的是,每个任务的主运行脚本都需要配置API_KEY:

1. 情感分析任务(Emotion Task)

步骤:

  1. 访问 https://open.bigmodel.cn 以申请API_KEY。
  2. emotion.py脚本中按照说明填写已获得的API_KEY。
  3. 使用以下命令来运行情绪分析任务的脚本:
    python emotion.py
    
  4. 适当修改prompt文件中的提示词,提高模型的准确度。
  5. (可选)更改emotion.py脚本中的模型参数或尝试使用不同类型的模型(脚本中第16到21行)来实验提升性能。

结果输出示例

image

2. 分词任务(Tokenization Task)

步骤:

  1. 访问 https://open.bigmodel.cn 以申请API_KEY。
  2. tokenization.py脚本中按照说明填写已获得的API_KEY。
  3. 使用以下命令来运行分词任务的脚本:
    python tokenization.py
    
  4. 尝试修改prompt文件中的提示词,以提升模型的性能。
  5. (可选)同学们可以更改tokenization.py脚本中的模型参数或尝试使用不同类型的模型(脚本中第57到62行)进行实验。

结果输出示例

image

3. 翻译任务(Translation Task)

步骤:

  1. 访问 https://open.bigmodel.cn 以申请API_KEY。
  2. translation.py脚本中按照说明填写已获得的API_KEY。
  3. 使用以下命令来运行翻译任务的脚本:
    python translation.py
    
  4. 适当调整prompt文件中的提示词,尝试提升模型的性能。
  5. (可选)同学们可以尝试更改translation.py脚本中的模型参数或使用不同类型的模型(脚本中第28到33行)进行实验,以寻找最佳性能配置。

结果输出示例

image

作业目标

  • 运行主脚本后,系统将输出模型的性能结果。同学们应尽可能调整提示词(prompt),或调整模型参数及更换模型来提高性能。

希望这份指南能够为同学们提供清晰和详细的步骤指导,祝同学们完成课程作业顺利!

code_nlp's People

Contributors

lakebodhi avatar uglyghost avatar

Watchers

 avatar

Forkers

pluto578

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.