Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos. #5709

Merged
merged 6 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ PaddleNLP针对信息抽取、语义检索、智能问答、情感分析等高

#### 🎙️ 智能语音指令解析

集成了[PaddleSpeech](https://github.com/PaddlePaddle/PaddleSpeech)和[百度开放平台](https://ai.baidu.com/)的的语音识别和[UIE](./model_zoo/uie)通用信息抽取等技术,打造智能一体化的语音指令解析系统范例,该方案可应用于智能语音填单、智能语音交互、智能语音检索等场景,提高人机交互效率。
集成了[PaddleSpeech](https://github.com/PaddlePaddle/PaddleSpeech)和[百度开放平台](https://ai.baidu.com/)的语音识别和[UIE](./model_zoo/uie)通用信息抽取等技术,打造智能一体化的语音指令解析系统范例,该方案可应用于智能语音填单、智能语音交互、智能语音检索等场景,提高人机交互效率。

<div align="center">
<img src="https://user-images.githubusercontent.com/16698950/168589100-a6c6f346-97bb-47b2-ac26-8d50e71fddc5.png" width="400">
Expand Down
2 changes: 1 addition & 1 deletion applications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ PaddleNLP 从预训练模型库出发,提供了经典预训练模型在主流

#### 🎙️ 智能语音指令解析

- 集成了[PaddleSpeech](https://github.com/PaddlePaddle/PaddleSpeech)和[百度开放平台](https://ai.baidu.com/)的的语音识别和[UIE](./model_zoo/uie)通用信息抽取等技术,打造智能一体化的语音指令解析系统范例,该方案可应用于智能语音填单、智能语音交互、智能语音检索等场景,提高人机交互效率。
- 集成了[PaddleSpeech](https://github.com/PaddlePaddle/PaddleSpeech)和[百度开放平台](https://ai.baidu.com/)的语音识别和[UIE](./model_zoo/uie)通用信息抽取等技术,打造智能一体化的语音指令解析系统范例,该方案可应用于智能语音填单、智能语音交互、智能语音检索等场景,提高人机交互效率。

<div align="center">
<img src="https://user-images.githubusercontent.com/16698950/168589100-a6c6f346-97bb-47b2-ac26-8d50e71fddc5.png" width="400">
Expand Down
2 changes: 1 addition & 1 deletion applications/document_intelligence/doc_vqa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- 售后客服:需要配置大量客服人员,且客服专业知识培训周期长
- 构建问题库:需要投入大量人力整理常见问题库,并且固定的问题库难以覆盖灵活多变的提问

对于用户来说,汽车说明书问答系统能够支持通过车机助手/APP/小程序为用户提供即问即答的的功能。对于常见问题,用户不再需要查阅说明书,也无需打客服电话,从而缓解了人工客服的压力。
对于用户来说,汽车说明书问答系统能够支持通过车机助手/APP/小程序为用户提供即问即答的功能。对于常见问题,用户不再需要查阅说明书,也无需打客服电话,从而缓解了人工客服的压力。

对于客服来讲,汽车说明书问答系统帮助客服人员快速定位答案,高效查阅文档,提高客服的专业水平,同时也能够缩短客服的培训周期。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _convert_example_to_record(self, example, max_seq_length, tokenizer):
# it easier for the model to learn the concept of sequences.
#
# For classification tasks, the first vector (corresponding to [CLS]) is
# used as as the "sentence vector". Note that this only makes sense because
# used as the "sentence vector". Note that this only makes sense because
# the entire model is fine-tuned.
tokens = []
text_type_ids = []
Expand Down
2 changes: 1 addition & 1 deletion applications/neural_search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

(2)采用文献的 query,title,keywords 三个字段内容,构造无标签数据集,进行无监督召回训练SimCSE;

(3)使用文献的的query, title, keywords,构造带正标签的数据集,不包含负标签样本,基于 In-batch Negatives 策略进行训练;
(3)使用文献的query, title, keywords,构造带正标签的数据集,不包含负标签样本,基于 In-batch Negatives 策略进行训练;

(4)在排序阶段,使用点击(作为正样本)和展现未点击(作为负样本)数据构造排序阶段的训练集,进行精排训练。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def parse_args():
parser.add_argument('--target_file_path', type=str, default=None, help='the target json file path')
parser.add_argument('--batch_size', type=int, default=1, help='the batch size when using taskflow')
parser.add_argument("--do_debug", action='store_true', help="Whether to do debug")
parser.add_argument('--a_prompt', type=str, default='答案', help='the prompt when using taskflow, seperate by ,')
parser.add_argument('--a_prompt', type=str, default='答案', help='the prompt when using taskflow, separate by ,')
parser.add_argument('--a_position_prob', type=float, default=0.01, help='confidence threshold for answer extraction')
parser.add_argument('--a_max_answer_candidates', type=int, default=5, help='the max number of return answer candidate for each input')
parser.add_argument('--q_num_return_sequences', type=int, default=3, help='the number of return sequences for each input sample, it should be less than num_beams')
Expand Down
4 changes: 2 additions & 2 deletions applications/sentiment_analysis/ASO_analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

### 2.2 架构&功能

本项目提出的的情感分析解决方案如图1所示,整个情感分析的过程大致包含两个阶段,依次是评论观点抽取模型,属性级情感分类模型。对于给定的一段文本,首先基于前者抽取出文本语句中潜在的评论属性以及该属性相应的评论观点,然后将评论属性、观点以及原始文本进行拼接,传给属性级情感分类模型以识别出该评论属性的情感极性。
本项目提出的情感分析解决方案如图1所示,整个情感分析的过程大致包含两个阶段,依次是评论观点抽取模型,属性级情感分类模型。对于给定的一段文本,首先基于前者抽取出文本语句中潜在的评论属性以及该属性相应的评论观点,然后将评论属性、观点以及原始文本进行拼接,传给属性级情感分类模型以识别出该评论属性的情感极性。

这里需要提到的是,由于目前市面上的大多数模型是基于通用语料训练出来的,这些模型可能并不会对情感信息那么敏感。基于这样的考量,本项目使用了百度自研的 SKEP 预训练模型,其在预训练阶段便设计了多种情感信息相关的预训练目标进行训练。作为一种情感专属的模型,其更适合用来做上边提到的评论观点抽取任务,以及属性级情感分类任务。

Expand Down Expand Up @@ -152,7 +152,7 @@ sh run_predict.sh
```

**(4)自定义模型训练**
如果你希望自己尝试进行评论观点抽取模型训练,可使用4.1节中提供的 `ext_data` Demo 数据,或自己业务的标注数据重新训练模型,本项目已将评论观点抽取模型的相关训练和测试代码放入 `extraction` 目录下, 请到该目录下执行模型训练即可,更多的实现细节和和使用方式,请参考[这里](extraction/README.md)。
如果你希望自己尝试进行评论观点抽取模型训练,可使用4.1节中提供的 `ext_data` Demo 数据,或自己业务的标注数据重新训练模型,本项目已将评论观点抽取模型的相关训练和测试代码放入 `extraction` 目录下, 请到该目录下执行模型训练即可,更多的实现细节和使用方式,请参考[这里](extraction/README.md)。

如果你希望自己尝试进行属性级情感分类模型训练,可使用4.1节中提供的 `cls_data` Demo 数据,或自己业务的标注数据重新训练模型,本项目已将属性级情感分类模型的相关训练和测试代码放入 `classification` 目录下,请到该目录下执行模型训练即可,更多的实现细节和使用方式,请参考[这里](classification/README.md)。

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 通用情感信息抽取

## **目录**
## **目录**
- [1. 情感分析应用简介](#1)
- [2. 特色介绍](#2)
Expand Down Expand Up @@ -31,7 +32,6 @@
- [6.1 基于SimpleServer进行服务化部署](#6.1)
- [6.2 基于Pipeline进行部署](#6.2)


<a name="1"></a>

## **1. 情感分析应用简介**
Expand Down Expand Up @@ -110,7 +110,7 @@ python3 -m pip install wordcloud==1.8.2.2
| `uie-base` | 0.86759 | 0.83696 | 0.85200 |
| `uie-senta-base` | 0.93403 | 0.92795 | 0.93098 |

另外,为方便用户体验和使用,本项目提供的情感分析能力已经集成到了 Taskflow,可以通过Taskflow开箱即用的的能力快速体验情感分析的功能
另外,为方便用户体验和使用,本项目提供的情感分析能力已经集成到了 Taskflow,可以通过Taskflow开箱即用的能力快速体验情感分析的功能

<a name="4.1"></a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def plot_aspect_with_opinion(
):
"""
generate image with aspect and opinion, that is, combining apsect with opinion to display the more specifical opinions of aspect.
this method can help you at two aspects: 1. mining custom's overall impression of products/services; 2. analyzing the quality of some aspect and improve it futher.
this method can help you at two aspects: 1. mining custom's overall impression of products/services; 2. analyzing the quality of some aspect and improve it further.

Args:
aspect_opinion (dict[dict] or dict): when sentiment set be "all", a expected dict containing aspect, opinion and its frequency, the key is aspect and its value is a dict containing the aspect's opinion and frequency. when sentiment set be "positive" or "netative", a expected dict containing aspect with opinion and frequency, the key is aspect with opinion and its value is frequency.
Expand Down
3 changes: 1 addition & 2 deletions applications/text_classification/hierarchical/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
- [2.5 模型部署](#模型部署)
- [2.6 模型效果](#模型效果)


<a name="层次分类简介"></a>

## 1. 层次分类简介
Expand Down Expand Up @@ -391,7 +390,7 @@ python prune.py \


可支持配置的参数:
* `output_dir`:必须,保存模型输出和和中间checkpoint的输出目录;默认为 `None` 。
* `output_dir`:必须,保存模型输出和中间checkpoint的输出目录;默认为 `None` 。
* `device`: 选用什么设备进行裁剪,选择cpu、gpu。如使用gpu训练,可使用参数--gpus指定GPU卡号。
* `per_device_train_batch_size`:训练集裁剪训练过程批处理大小,请结合显存情况进行调整,若出现显存不足,请适当调低这一参数;默认为32。
* `per_device_eval_batch_size`:开发集评测过程批处理大小,请结合显存情况进行调整,若出现显存不足,请适当调低这一参数;默认为32。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ cat ../data/train_dirty_rest.txt ../data/train_dirty.txt > ../data/train_clean.t

**方案效果**

我们在[2020语言与智能技术竞赛:事件抽取任务](https://aistudio.baidu.com/aistudio/competition/detail/32/0/introduction)抽取部分训练数据(训练集数据规模:2000)进行实验,取200条数据进行脏数据处理,也即200条训练数据为标签错误数据,选择不同`dirty_num`应用脏数据清洗策略进行评测:
我们在[2020语言与智能技术竞赛:事件抽取任务](https://aistudio.baidu.com/aistudio/competition/detail/32/0/introduction)抽取部分训练数据(训练集数据规模:2000)进行实验,取200条数据进行脏数据处理,也即200条训练数据为标签错误数据,选择不同`dirty_num`应用脏数据清洗策略进行评测:

| |Micro F1(%) | Macro F1(%) |
| ---------| ------------ |------------ |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ I0619 13:43:33.409775 5127 http_server.cc:167] Started Metrics Service at 0.0.0.
## 客户端请求

### 客户端环境准备
客户端请求有两种方式,可以选择在在本地执行脚本请求,或下载官方客户端镜像在容器中执行。
客户端请求有两种方式,可以选择在本地执行脚本请求,或下载官方客户端镜像在容器中执行。

方式一:本地执行脚本,需要先安装依赖:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def load_local_dataset(data_path, splits, label_list):
"""
Load dataset for hierachical classification from files, where
there is one example per line. Text and label are seperated
there is one example per line. Text and label are separated
by '\t', and multiple labels are delimited by ','.

Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
parser = argparse.ArgumentParser()
parser.add_argument("--model_dir", type=str, required=True, help="The directory to static model.")
parser.add_argument("--corpus_file", type=str, required=True, help="The corpus_file path.")
parser.add_argument("--output_dir", type=str, required=True, help="The ouput path.")
parser.add_argument("--output_dir", type=str, required=True, help="The output path.")
parser.add_argument("--max_seq_length", default=64, type=int, help="The maximum total input sequence length after tokenization. Sequences longer than this will be truncated, sequences shorter will be padded.")
parser.add_argument("--batch_size", default=32, type=int, help="Batch size per GPU/CPU for training.")
parser.add_argument('--device', choices=['cpu', 'gpu', 'xpu'], default="gpu", help="Select which device to train model, defaults to gpu.")
Expand Down
2 changes: 1 addition & 1 deletion applications/text_classification/multi_class/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ python -m paddle.distributed.launch --gpus 0,1 train.py \
- `label_path`: 标签路径,默认为"./data/label.txt"。
- `bad_case_path`: 错误样本保存路径,默认为"./data/bad_case.txt"。
- `width_mult_list`:裁剪宽度(multi head)保留的比例列表,表示对self_attention中的 `q`、`k`、`v` 以及 `ffn` 权重宽度的保留比例,保留比例乘以宽度(multi haed数量)应为整数;默认是None。
训练脚本支持所有`TraingArguments`的参数,更多参数介绍可参考[TrainingArguments 参数介绍](https://paddlenlp.readthedocs.io/zh/latest/trainer.html#trainingarguments)。
训练脚本支持所有`TrainingArguments`的参数,更多参数介绍可参考[TrainingArguments 参数介绍](https://paddlenlp.readthedocs.io/zh/latest/trainer.html#trainingarguments)。

程序运行时将会自动进行训练,评估。同时训练过程中会自动保存开发集上最佳模型在指定的 `output_dir` 中,保存模型文件结构如下所示:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ cat ../data/train_dirty_rest.txt ../data/train_dirty.txt > ../data/train_clean.t

**方案效果**

我们在KUAKE-QIC数据集部分数据(训练集数据规模:500)进行实验,取100条数据进行脏数据处理,也即100条训练数据为标签错误数据,选择不同`dirty_num`应用脏数据清洗策略进行评测:
我们在KUAKE-QIC数据集部分数据(训练集数据规模:500)进行实验,取100条数据进行脏数据处理,也即100条训练数据为标签错误数据,选择不同`dirty_num`应用脏数据清洗策略进行评测:

| |Accuracy(%) |
| ---------| ------------ |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ I0619 13:43:33.409775 5127 http_server.cc:167] Started Metrics Service at 0.0.0.
## 客户端请求

### 客户端环境准备
客户端请求有两种方式,可以选择在在本地执行脚本请求,或下载官方客户端镜像在容器中执行。
客户端请求有两种方式,可以选择在本地执行脚本请求,或下载官方客户端镜像在容器中执行。

方式一:本地执行脚本,需要先安装依赖:
```shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
parser = argparse.ArgumentParser()
parser.add_argument("--model_dir", type=str, required=True, help="The directory to static model.")
parser.add_argument("--corpus_file", type=str, required=True, help="The corpus_file path.")
parser.add_argument("--output_dir", type=str, required=True, help="The ouput path.")
parser.add_argument("--output_dir", type=str, required=True, help="The output path.")
parser.add_argument("--max_seq_length", default=64, type=int, help="The maximum total input sequence length after tokenization. Sequences longer than this will be truncated, sequences shorter will be padded.")
parser.add_argument("--batch_size", default=32, type=int, help="Batch size per GPU/CPU for training.")
parser.add_argument('--device', choices=['cpu', 'gpu', 'xpu'], default="gpu", help="Select which device to train model, defaults to gpu.")
Expand Down
3 changes: 1 addition & 2 deletions applications/text_classification/multi_label/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# 多标签分类指南

**目录**
**目录**
- [1. 多标签分类简介](#多标签分类简介)
- [2. 快速开始](#快速开始)
Expand Down Expand Up @@ -388,7 +387,7 @@ python prune.py \


可支持配置的参数:
* `output_dir`:必须,保存模型输出和和中间checkpoint的输出目录;默认为 `None` 。
* `output_dir`:必须,保存模型输出和中间checkpoint的输出目录;默认为 `None` 。
* `device`: 选用什么设备进行裁剪,选择cpu、gpu。如使用gpu训练,可使用参数--gpus指定GPU卡号。
* `per_device_train_batch_size`:训练集裁剪训练过程批处理大小,请结合显存情况进行调整,若出现显存不足,请适当调低这一参数;默认为32。
* `per_device_eval_batch_size`:开发集评测过程批处理大小,请结合显存情况进行调整,若出现显存不足,请适当调低这一参数;默认为32。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ I0619 13:43:33.409775 5127 http_server.cc:167] Started Metrics Service at 0.0.0.
## 客户端请求

### 客户端环境准备
客户端请求有两种方式,可以选择在在本地执行脚本请求,或下载官方客户端镜像在容器中执行。
客户端请求有两种方式,可以选择在本地执行脚本请求,或下载官方客户端镜像在容器中执行。

方式一:本地执行脚本,需要先安装依赖:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def load_local_dataset(data_path, splits, label_list):
"""
Load dataset for multi-label classification from files, where
there is one example per line. Text and label are seperated
there is one example per line. Text and label are separated
by '\t', and multiple labels are delimited by ','.

Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
parser = argparse.ArgumentParser()
parser.add_argument("--model_dir", type=str, required=True, help="The directory to static model.")
parser.add_argument("--corpus_file", type=str, required=True, help="The corpus_file path.")
parser.add_argument("--output_dir", type=str, required=True, help="The ouput path.")
parser.add_argument("--output_dir", type=str, required=True, help="The output path.")
parser.add_argument("--max_seq_length", default=64, type=int, help="The maximum total input sequence length after tokenization. Sequences longer than this will be truncated, sequences shorter will be padded.")
parser.add_argument("--batch_size", default=32, type=int, help="Batch size per GPU/CPU for training.")
parser.add_argument('--device', choices=['cpu', 'gpu', 'xpu'], default="gpu", help="Select which device to train model, defaults to gpu.")
Expand Down
2 changes: 1 addition & 1 deletion applications/zero_shot_text_classification/README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ python label_studio.py \
--options ./data/label.txt
```

For multi-task training, you can convert data with script seperately and move them to the same directory.
For multi-task training, you can convert data with script separately and move them to the same directory.

<a name="23"></a>

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced_guide/model_compression/ofa_bert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
------------

1. 首先对预训练模型的参数和head根据其重要性进行重排序,把重要的参数和head排在参数的前侧,保证训练过程中的参数裁剪不会裁剪掉这些重要的参数。\
参数的重要性计算是先使用dev数据计算一遍每个参数的梯度,然后根据梯度和参数的整体大小来计算当前参数的重要性,head的的重要性计算是通过传入一个\
参数的重要性计算是先使用dev数据计算一遍每个参数的梯度,然后根据梯度和参数的整体大小来计算当前参数的重要性,head的重要性计算是通过传入一个\
全1的对head的mask,并计算这个mask的梯度,根据mask的梯度来判断每个 ``Multi-Head Attention`` 层中每个Head的重要性。

2. 使用原本的预训练模型作为蒸馏过程中的教师网络。同时定义一个超网络,这个超网络中最大的子网络的结构和教师网络的结构相同其他小的子网络是对最大网络\
Expand Down
Loading