Skip to content

neverbiasu/IELTSDuck

Repository files navigation

雅鸭IELTSDuck - IELTS作文小助手

雅鸭IELTSDuck - IELTS作文小助手

license evaluation

🤗HuggingFace | OpenXLab_Model | ModelScope

🆕Update News | 🤔Reporting Issues简体中文

📝目录

📖 项目概述

  雅鸭IELTSDuck是一款基于InternLM2进行QLoRA微调,专为雅思考生(主要针对初级与中级水平学习者)开发的创新LLMs辅导工具,旨在通过综合提升学生的雅思写作能力。

雅思考试是为那些打算在以英语作为交流语言的国家和地区留学或就业的人们设置的英语言水平考试,从听、说、读、写四方面进行英语能力全面考核,能够立体综合地精准测评考生的英语语言运用能力。

  雅鸭IELTSDuck整合了作文结构引导、语法检查与改进、内容与逻辑评估以及智能评分等多功能,致力于帮助学生提升雅思写作水平。

雅思考试评分标准包括:语言的流利度和连贯性,词汇变换,句式丰富性和语法准确性,发音。雅思考试考官按这四项评分标准分别评等级分,并且这四项是同等重要的。雅思成绩包括一个总分,及听力、阅读、写作和口语四个单项分,考生的考试成绩采用1-9分的评分制来测评,四个项目独立记分,总分即是四个部分所得分数经过平均后四舍五入的成绩。总分和四个单项分均允许半分。

😊 主要功能

  • 固定模板输出模块: 利用LLMs技术,提供针对雅思写作评分的专业、有逻辑、分点清晰的模板,帮助学生构建作文结构。
  • 语法检查与改进模块: 通过Langchain RAG技术和InternLM大型语言模型的整合,实时识别并纠正作文中的语法错误,并给出具体的修改建议。
  • 内容与逻辑评估模块: 对学生的作文进行全面分析,给出针对性的优化建议,确保作文内容、结构和逻辑满足雅思官方评分标准。
  • 智能评分模块: 通过微调InternLM,自动评估学生作文的综合质量,提供接近官方评分标准的分数,并给出改善作文的具体指导。

🛠️ 项目愿景

雅鸭IELTSDuck致力于帮助学生提升雅思写作成绩,同时通过系统化学习和练习,培养学生的逻辑思维和语言表达能力,助力学生在全球化语境中进行有效沟通。

雅鸭IELTSDuck全流程如图所示:

alt text

🔗 模型及体验地址

OpenXLab 模型文件:

https://openxlab.org.cn/models/detail/milowang/IELTS_essay_eval_7b_v1

OpenXLab 应用

https://openxlab.org.cn/apps/detail/Fayche/IELTSDuck

🚀 News

🧾 数据集

  雅鸭IELTSDuck使用爬虫将网络上中雅思作文的数据提取出来,作为数据集使用。数据集采用雅思不同成绩的作文以及作文的批改建议,

数据集样例:

题目


Interview form the basic selection criteria for most large companies. However, some people think that interview is not a reliable method of choosing whom to employ and there are better methods. To what extent to you agree or disagree?	

文章
To agree or disagree with the statement that interviews are the basic filteration criteria is an important issue. Putting the discussion in a wider context, interviews has always been debatable. Even though some people think that there are better methods for employing a resource rather than interviews , I wholeheartedly believe that interview is a good method for recruiting candidates. First I will discuss some arguments supporting my ideas about this statement, after which some aspects against that will be presented.

On the one hand, many people agree with this statement for many noteworthy reasons. The most remarkable is that the recruiters can get an idea about the personalitty and skills of the potential employees .For instance,when the person is asked about any topic and he answers it in a concise and crisp manner,then the recruiter gets to know he is suitable for the job. Another key reason is that if a candidate is asked about case studies then the recruiters can judge the personality traits of that employee and also the ability to think outside the box.

On the other hand, other people disagree with this statement for many reasons. They believe that other modes of recruiting like written tests and group discussions will help understand the mindset in a better manner.Written tests help in evaluating the technical or theoretical knowlege of a person.

Group discussions help in getting a grasp of the conversational skills that he/she possesses.For example,in sales and marketing jobs conversational skills play a major role.

All in all, when all the specific reasons and relevant examples are considered and evaluated, I strongly agree with the idea supporting this statement because its benefits outweigh its drawbacks.	**Task Achievement (6.5)**
- The essay effectively addresses the task and presents a clear stance on the issue of whether interviews are a reliable method of employee selection.
- The ideas presented are relevant to the task and are supported with appropriate arguments and examples.
- The essay covers all aspects of the task, including the advantages and disadvantages of using interviews for hiring.

批改建议
**Coherence and Cohesion (7.0)**
- The essay is well-organized and the transitions between sentences and paragraphs are smooth and logical.
- The use of connecting words and phrases helps maintain a clear progression of ideas.
- The essay follows a logical structure, with an introduction, body paragraphs that present opposing viewpoints, and a conclusion that summarizes the main points.

**Lexical Resource (6.0)**
- The essay uses a range of vocabulary, including some more complex and technical terms related to the topic of employee selection.
- There are some minor inaccuracies in vocabulary usage, such as the use of "personalitty" instead of "personality" and "crisp" instead of "clear."
- The vocabulary is generally appropriate for the given context.

**Grammatical Range and Accuracy (6.5)**
- The essay exhibits a variety of sentence structures, including complex and compound sentences.
- There are some grammatical errors, such as incorrect verb forms (e.g., "helps understand" instead of "helps one understand") and sentence construction (e.g., "For example,in sales and marketing jobs conversational skills play a major role.").
- The use of punctuation is generally correct, but there are some minor errors with commas.

**Overall Band Score: 6.5**
- The essay meets the requirements of the task and presents a clear and well-supported argument.
- The organization and structure of the essay are logical and coherent.
- The use of vocabulary is generally appropriate, but with some minor inaccuracies.
- There are some grammatical errors, but they do not significantly affect the overall quality of the essay.

**Feedback and Additional Comments:**

- **Strengths:** The essay effectively addresses the task, presents a clear stance, and provides relevant arguments and examples. The organization and structure of the essay are also strong.
- **Areas for improvement:** The essay could be improved by addressing the grammatical errors and inaccuracies in vocabulary usage. Additionally, the use of more complex sentence structures and a wider range of vocabulary would enhance the overall quality of the essay.	6.5

💼 使用方法

快速开始

  1. clone 本项目
git clone https://github.com/neverbiasu/IELTSDuck.git
cd IELTSDuck
  1. 创建环境
# conda 创建虚拟环境(可选)
conda create -n ieltsduck python=3.8
conda activate ieltsduck
# 安装所需依赖
pip install -r requirements.txt
  1. 下载模型
从 ModelScope

参考 模型的下载

pip install modelscope
from modelscope.hub.snapshot_download import snapshot_download
model_dir = snapshot_download('kmno4zx/huanhuan-chat-internlm2', cache_dir='./')
从 OpenXLab

参考 下载模型

pip install openxlab
from openxlab.model import download
download(model_repo='milowang/IELTS_essay_eval_cn_7b_v1', 
        model_name='IELTSDuck', output='./')
  1. 本地部署
python start.py

重新训练

本模型使用使用 XTuner 训练, XTuner有各个模型的一键训练脚本,相对便捷。且对 InternLM2 的支持度最高。

XTuner微调

  使用 XTuner 进行微调,具体脚本可参考internlm2_chat_7b_qlora_oasst1_e3_copy.py,该脚本在train文件夹下。脚本内有较为详细的注释。

部署

OpenXLab 部署 IELTDuck

  仅需要 Fork 本仓库,然后在 OpenXLab 上创建一个新的项目,将 Fork 的仓库与新建的项目关联,即可在 OpenXLab 上部署 IELTSDuck。

  OPenXLab IELTSDuck https://openxlab.org.cn/apps/detail/Fayche/IELTSDuck

Alt text

LmDeploy部署

  • 首先安装LmDeploy
pip install -U lmdeploy
  • 然后转换模型为turbomind格式

--dst-path: 可以指定转换后的模型存储位置。

lmdeploy convert internlm2-chat-7b  要转化的模型地址 --dst-path 转换后的模型地址
  • LmDeploy Chat 对话
lmdeploy chat turbomind 转换后的turbomind模型地址

测评与量化

OpneCompass 评测

  • 安装 OpenCompass
git clone https://github.com/open-compass/opencompass
cd opencompass
pip install -e .
  • 下载解压数据集
cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/
unzip OpenCompassData-core-20231110.zip
  • 评测启动!
python run.py \
    --datasets ceval_gen \
    --hf-path /root/model/huanhuan/kmno4zx/huanhuan-chat-internlm2 \
    --tokenizer-path /root/model/huanhuan/kmno4zx/huanhuan-chat-internlm2 \
    --tokenizer-kwargs padding_side='left' truncation='left'     trust_remote_code=True \
    --model-kwargs device_map='auto' trust_remote_code=True \
    --max-seq-len 2048 \
    --max-out-len 16 \
    --batch-size 2  \
    --num-gpus 1 \
    --debug

Lmdeploy&opencompass 量化以及量化评测

W4量化评测
  • W4量化
lmdeploy lite auto_awq 要量化的模型地址 --work-dir 量化后的模型地址
  • 转化为TurbMind
lmdeploy convert internlm2-chat-7b 量化后的模型地址  --model-format awq --group-size 128 --dst-path 转换后的模型地址
  • 评测config编写
from mmengine.config import read_base
from opencompass.models.turbomind import TurboMindModel

with read_base():
 # choose a list of datasets   
 from .datasets.ceval.ceval_gen import ceval_datasets 
 # and output the results in a choosen format
#  from .summarizers.medium import summarizer

datasets = [*ceval_datasets]

internlm2_chat_7b = dict(
     type=TurboMindModel,
     abbr='internlm2-chat-7b-turbomind',
     path='转换后的模型地址',
     engine_config=dict(session_len=512,
         max_batch_size=2,
         rope_scaling_factor=1.0),
     gen_config=dict(top_k=1,
         top_p=0.8,
         temperature=1.0,
         max_new_tokens=100),
     max_out_len=100,
     max_seq_len=512,
     batch_size=2,
     concurrency=1,
     #  meta_template=internlm_meta_template,
     run_cfg=dict(num_gpus=1, num_procs=1),
)
models = [internlm2_chat_7b]
  • 评测启动!
python run.py configs/eval_turbomind.py -w 指定结果保存路径
KV Cache量化评测
  • 转换为TurbMind
lmdeploy convert internlm2-chat-7b  模型路径 --dst-path 转换后模型路径
  • 计算与获得量化参数
# 计算
lmdeploy lite calibrate 模型路径 --calib-dataset 'ptb' --calib-samples 128 --calib-seqlen 2048 --work-dir 参数保存路径
# 获取量化参数
lmdeploy lite kv_qparams 参数保存路径 转换后模型路径/triton_models/weights/ --num-tp 1
  • 更改quant_policy改成4,更改上述config里面的路径
  • 评测启动!
python run.py configs/eval_turbomind.py -w 结果保存路径

结果文件可在同目录文件results中获取

⚠️ 注意

虽然雅鸭IELTSDuck致力于提升学生的雅思写作能力,但最终的学习成效还需依赖于个人的努力和实践。我们鼓励用户以积极主动的态度使用本系统,持续学习和练习。

💕 致谢

我们热烈欢迎并鼓励社区成员对雅鸭IELTSDuck项目做出贡献。如果您有兴趣帮助我们改进,请查看我们的贡献指南

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published