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 5 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,35 +1,35 @@
# 通用情感信息抽取

## **目录**
- [1. 情感分析应用简介](#1)
- [2. 特色介绍](#2)
- [3. 运行环境](#3)
- [4. 整体功能介绍与Taskflow快速体验](#4)
- [4.1 开箱即用的情感分析能力](#4.1)
- [4.1.1 语句级情感分析](#4.1.1)
- [4.1.2 属性级情感分析](#4.1.2)
- [4.1.3 多版本模型选择](#4.1.3)
- [4.2 批量处理:从数据到情感分析可视化](#4.2)
- [4.2.1 数据描述](#4.2.1)
- [4.2.2 批量情感分析](#4.2.2)
- [4.2.3 情感分析可视化](#4.2.3)
- [4.2.3.1 一键生成情感分析结果](#4.2.3.1)
- [4.2.3.2 情感分析详细展示](#4.2.3.2)
- [5. 更进一步:结合业务分析经验,定制情感分析](#5)
- [5.1 打通数据标注到训练样本构建](#5.1)
- [5.1.1 样本构建:语句级情感分类任务](#5.1.1)
- [5.1.2 样本构建:属性抽取相关任务](#5.1.2)
- [5.1.3 样本构建升级1:加强属性聚合能力](#5.1.3)
- [5.1.4 样本构建升级2:加强隐性观点抽取能力](#5.1.4)
- [5.2 模型训练](#5.2)
- [5.3 模型测试](#5.3)
- [5.4 模型预测及效果展示](#5.4)
- [5.4.1 使用训练后的模型进行预测](#5.4.1)
- [5.4.2 属性聚合预测和分析](#5.4.2)
- [5.4.3 隐性观点词抽取预测和分析](#5.4.3)
- [6. 模型部署](#6)
- [6.1 基于SimpleServer进行服务化部署](#6.1)
- [6.2 基于Pipeline进行部署](#6.2)
- [通用情感信息抽取](#通用情感信息抽取)
- [**目录**](#目录)
- [**1. 情感分析应用简介**](#1-情感分析应用简介)
- [**2. 特色介绍**](#2-特色介绍)
- [**3. 运行环境**](#3-运行环境)
- [**4. 整体功能介绍与Taskflow快速体验**](#4-整体功能介绍与taskflow快速体验)
- [**4.1 开箱即用的情感分析能力**](#41-开箱即用的情感分析能力)
- [**4.1.1 语句级情感分析**](#411-语句级情感分析)
- [**4.1.2 属性级情感分析**](#412-属性级情感分析)
- [**4.1.3 多版本模型选择**](#413-多版本模型选择)
- [**4.2 批量处理:从数据到情感分析可视化**](#42-批量处理从数据到情感分析可视化)
- [**4.2.1 数据描述**](#421-数据描述)
- [**4.2.2 批量情感分析**](#422-批量情感分析)
- [**4.2.3 情感分析可视化**](#423-情感分析可视化)
- [**5. 更进一步:结合业务分析经验,定制情感分析**](#5-更进一步结合业务分析经验定制情感分析)
- [**5.1 打通数据标注到训练样本构建**](#51-打通数据标注到训练样本构建)
- [**5.1.1 样本构建:语句级情感分类任务**](#511-样本构建语句级情感分类任务)
- [**5.1.2 样本构建:属性抽取相关任务**](#512-样本构建属性抽取相关任务)
- [**5.1.3 样本构建升级1:加强属性聚合能力**](#513-样本构建升级1加强属性聚合能力)
- [**5.1.4 样本构建升级2:加强隐性观点抽取能力**](#514-样本构建升级2加强隐性观点抽取能力)
- [**5.2 模型训练**](#52-模型训练)
- [**5.3 模型测试**](#53-模型测试)
- [**5.4 模型预测及效果展示**](#54-模型预测及效果展示)
- [**5.4.1 使用训练后的模型进行预测**](#541-使用训练后的模型进行预测)
- [**5.4.2 属性聚合预测和分析**](#542-属性聚合预测和分析)
- [**5.4.3 隐性观点词抽取预测和分析**](#543-隐性观点词抽取预测和分析)
- [**6. 模型部署**](#6-模型部署)
- [**6.1 基于SimpleServer进行服务化部署**](#61-基于simpleserver进行服务化部署)
- [**6.2 基于Pipeline进行部署**](#62-基于pipeline进行部署)


<a name="1"></a>
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
25 changes: 16 additions & 9 deletions applications/text_classification/hierarchical/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# 层次分类指南

**目录**
- [1. 层次分类简介](#层次分类简介)
- [2. 快速开始](#快速开始)
- [2.1 运行环境](#运行环境)
- [2.2 代码结构](#代码结构)
- [2.3 数据准备](#数据准备)
- [2.4 模型训练](#模型训练)
- [2.5 模型部署](#模型部署)
- [2.6 模型效果](#模型效果)
- [层次分类指南](#层次分类指南)
- [1. 层次分类简介](#1-层次分类简介)
- [2. 快速开始](#2-快速开始)
- [2.1 运行环境](#21-运行环境)
- [2.2 代码结构](#22-代码结构)
- [2.3 数据准备](#23-数据准备)
- [2.4 模型训练](#24-模型训练)
- [2.4.1 预训练模型微调](#241-预训练模型微调)
- [2.4.2 训练评估与模型优化](#242-训练评估与模型优化)
- [2.4.3 模型预测](#243-模型预测)
- [2.5 模型部署](#25-模型部署)
- [2.5.1 静态图导出](#251-静态图导出)
- [2.5.2 模型裁剪](#252-模型裁剪)
- [2.5.3 部署方案](#253-部署方案)
- [2.6 模型效果](#26-模型效果)


<a name="层次分类简介"></a>
Expand Down Expand Up @@ -391,7 +398,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
25 changes: 14 additions & 11 deletions applications/text_classification/hierarchical/analysis/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# 训练评估与模型优化指南

**目录**
* [Analysis模块介绍](#Analysis模块介绍)
* [环境准备](#环境准备)
* [模型评估](#模型评估)
* [可解释性分析](#可解释性分析)
* [单词级别可解释性分析](#单词级别可解释性分析)
* [句子级别可解释性分析](#句子级别可解释性分析)
* [数据优化](#数据优化)
* [稀疏数据筛选方案](#稀疏数据筛选方案)
* [脏数据清洗方案](#脏数据清洗方案)
* [数据增强策略方案](#数据增强策略方案)
- [训练评估与模型优化指南](#训练评估与模型优化指南)
- [Analysis模块介绍](#analysis模块介绍)
- [环境准备](#环境准备)
- [模型评估](#模型评估)
- [可解释性分析](#可解释性分析)
- [单词级别可解释性分析](#单词级别可解释性分析)
- [句子级别可解释性分析](#句子级别可解释性分析)
- [数据优化](#数据优化)
- [稀疏数据筛选方案](#稀疏数据筛选方案)
- [稀疏数据识别—数据增强](#稀疏数据识别数据增强)
- [稀疏数据识别-数据标注](#稀疏数据识别-数据标注)
- [脏数据清洗方案](#脏数据清洗方案)
- [数据增强策略方案](#数据增强策略方案)

## Analysis模块介绍

Expand Down Expand Up @@ -373,7 +376,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
Loading