mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-09 02:20:17 +08:00
Add uie python example and doc (#221)
* add fastdeploy.text.UIEModel * Add uie python example * Add one schema for cpp demo * Add ConvertUIEResultToDict for pretty the uie result in python * remove default args for SchemaNode * Add uie example args * Add uie python api desc * Add infer.py usage * truncate some example output * Add uie schema usage * Add uie result md * Add uie c++ api doc
This commit is contained in:
7
docs/api/text_results/README.md
Normal file
7
docs/api/text_results/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 自然语言模型预测结果说明
|
||||
|
||||
FastDeploy根据自然语言模型的任务类型,定义了不同的结构体来表达模型预测结果,具体如下表所示
|
||||
|
||||
| 结构体 | 文档 | 说明 | 相应模型 |
|
||||
| :----- | :--- | :---- | :------- |
|
||||
| UIEResult | [C++/Python文档](./uie_result.md) | UIE模型返回结果 | UIE模型 |
|
34
docs/api/text_results/uie_result.md
Normal file
34
docs/api/text_results/uie_result.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# UIEResult 图像分类结果
|
||||
|
||||
UIEResult代码定义在`fastdeploy/text/uie/model.h`中,用于表明UIE模型抽取结果和置信度。
|
||||
|
||||
## C++ 定义
|
||||
|
||||
`fastdeploy::text::UIEResult`
|
||||
|
||||
```c++
|
||||
struct UIEResult {
|
||||
size_t start_;
|
||||
size_t end_;
|
||||
double probability_;
|
||||
std::string text_;
|
||||
std::unordered_map<std::string, std::vector<UIEResult>> relation_;
|
||||
std::string Str() const;
|
||||
};
|
||||
```
|
||||
|
||||
- **start_**: 成员变量,表示抽取结果text_在原文本(Unicode编码)中的起始位置。
|
||||
- **end**: 成员变量,表示抽取结果text_在原文本(Unicode编码)中的结束位置。
|
||||
- **text_**: 成员函数,表示抽取的结果,以UTF-8编码方式保存。
|
||||
- **relation_**: 成员函数,表示当前结果关联的结果。常用于关系抽取。
|
||||
- **Str()**: 成员函数,将结构体中的信息以字符串形式输出(用于Debug)
|
||||
|
||||
## Python 定义
|
||||
|
||||
`fastdeploy.text.C.UIEResult`
|
||||
|
||||
- **start_**(int): 成员变量,表示抽取结果text_在原文本(Unicode编码)中的起始位置。
|
||||
- **end**(int): 成员变量,表示抽取结果text_在原文本(Unicode编码)中的结束位置。
|
||||
- **text_**(str): 成员函数,表示抽取的结果,以UTF-8编码方式保存。
|
||||
- **relation_**(dict(str, list(fastdeploy.text.C.UIEResult))): 成员函数,表示当前结果关联的结果。常用于关系抽取。
|
||||
- **get_dict()**: 以dict形式返回fastdeploy.text.C.UIEResult。
|
Reference in New Issue
Block a user