Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
939c4853
M
models
项目概览
PaddlePaddle
/
models
大约 2 年 前同步成功
通知
232
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
939c4853
编写于
10月 22, 2019
作者:
B
bbking
提交者:
GitHub
10月 22, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PaddleNLP] fix emotion_detection open problem, add paddlehub version (#3706)
* update emotion-detection readme and fix open problem
上级
6ed5f04d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
6 deletion
+9
-6
PaddleNLP/emotion_detection/README.md
PaddleNLP/emotion_detection/README.md
+6
-4
PaddleNLP/emotion_detection/config.py
PaddleNLP/emotion_detection/config.py
+2
-1
PaddleNLP/emotion_detection/inference_model.py
PaddleNLP/emotion_detection/inference_model.py
+1
-1
未找到文件。
PaddleNLP/emotion_detection/README.md
浏览文件 @
939c4853
...
...
@@ -25,7 +25,7 @@
| BERT | 93.6% | 92.3% | 78.6% |
| ERNIE | 94.4% | 94.0% | 80.6% |
同时推荐用户参考
[
IPython Notebook demo
](
https://aistudio.baidu.com/aistudio/projectDetail/122291
)
同时推荐用户参考
[
IPython Notebook demo
](
https://aistudio.baidu.com/aistudio/projectDetail/122291
)
。
## 快速开始
...
...
@@ -33,7 +33,7 @@
1.
PaddlePaddle 安装
本项目依赖于 PaddlePaddle Fluid 1.6 及以上版本,请参考
[
安装指南
](
http://www.paddlepaddle.org/#quick-start
)
进行安装
本项目依赖于 PaddlePaddle Fluid 1.6 及以上版本,请参考
[
安装指南
](
http://www.paddlepaddle.org/#quick-start
)
进行安装
。
2.
代码安装
...
...
@@ -46,7 +46,7 @@
3.
环境依赖
Python 2 的版本要求 2.7.15+,Python 3 的版本要求 3.5.1+/3.6/3.7,其它环境请参考 PaddlePaddle
[
安装说明
](
https://www.paddlepaddle.org.cn/documentation/docs/zh/1.5/beginners_guide/install/index_cn.html
)
部分的内容
Python 2 的版本要求 2.7.15+,Python 3 的版本要求 3.5.1+/3.6/3.7,其它环境请参考 PaddlePaddle
[
安装说明
](
https://www.paddlepaddle.org.cn/documentation/docs/zh/1.5/beginners_guide/install/index_cn.html
)
部分的内容
。
### 代码结构说明
...
...
@@ -305,7 +305,7 @@ Final test result:
我们也提供了使用 PaddleHub 加载 ERNIE 模型的选项,PaddleHub 是 PaddlePaddle 的预训练模型管理工具,可以一行代码完成预训练模型的加载,简化预训练模型的使用和迁移学习。更多相关的介绍,可以查看
[
PaddleHub
](
https://github.com/PaddlePaddle/PaddleHub
)
注意:使用该选项需要先安装PaddleHub,安装命令如下
注意:使用该选项需要先安装PaddleHub
>= 1.2.0
,安装命令如下
```
shell
pip
install
paddlehub
```
...
...
@@ -336,6 +336,8 @@ sh run_ernie.sh infer
## 版本更新
2019/10/21 PaddlePaddle1.6适配,添加download.py脚本。
2019/08/26 规范化配置的使用,对模块内数据处理代码进行了重构,更新README结构,提高易用性。
2019/06/13 添加PaddleHub调用ERNIE方式。
...
...
PaddleNLP/emotion_detection/config.py
浏览文件 @
939c4853
...
...
@@ -19,6 +19,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
io
import
os
import
six
import
json
...
...
@@ -122,7 +123,7 @@ class PDConfig(object):
return
try
:
with
open
(
file_path
,
"r"
)
as
fin
:
with
io
.
open
(
file_path
,
"r"
)
as
fin
:
self
.
json_config
=
json
.
load
(
fin
)
except
Exception
as
e
:
raise
IOError
(
"Error in parsing json config file '%s'"
%
file_path
)
...
...
PaddleNLP/emotion_detection/inference_model.py
浏览文件 @
939c4853
# -*-
encoding: UTF
8 -*-
# -*-
coding: UTF-
8 -*-
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录