An open API service indexing awesome lists of open source software.

https://github.com/taishan1994/pytorch_chinese_albert_attribute_extraction

基于pytorch_albert的属性抽取
https://github.com/taishan1994/pytorch_chinese_albert_attribute_extraction

Last synced: 2 months ago
JSON representation

基于pytorch_albert的属性抽取

Awesome Lists containing this project

README

          

# pytorch_chinese_albert_attribute_extraction
基于pytorch_albert的中文属性抽取,该项目是在:https://github.com/hackerxiaobai/OpenTag_2019 上进行的一些改动。数据和模型下载地址:

链接:https://pan.baidu.com/s/1QQmwB1NVkuhE-46fbMeYNw?pwd=egry

提取码:egry

# 依赖

```
pytorch==1.6.0
seqeval
pytorch-crf==0.7.2
```

# 运行

通过在config.py里面更改配置以指定训练、验证、测试和预测

```python
python train.py
```

### 测试结果

这里只针对于品牌进行的测试:

```
precision recall f1-score support

_ 0.93 0.94 0.93 3367

micro avg 0.93 0.94 0.93 3367
macro avg 0.93 0.94 0.93 3367
weighted avg 0.93 0.94 0.93 3367
```

## 预测结果

```
text: ['y', '日', '着', '原', '创', '设', '计', '2019', '夏', '季', '新', '款', '蓝', '色', '基', '础', '百', '搭', 't', '恤', '女']
entities:
['品 牌', '日 着']
text: ['美', '国', '采', '购', 'bugaboo', 'bee3', '/', 'bee5', '婴', '儿', '推', '车', '自', '立', '式', '支', '架', '推', '车', '配', '件', '小', '黑', '尾']
entities:
['品 牌', 'bugaboo bee3']
text: ['孕', '之', '彩', '2019', '夏', '季', '新', '款', '短', '袖', '孕', '妇', '裙', 'ywq292941', '休', '闲', '条', '纹', '针', '织', 't', '恤', '连', '衣', '裙']
entities:
['品 牌', '孕 之 彩']
text: ['丽', '婴', '房', '彼', '得', '兔', '夏', '装', '女', '童', '时', '尚', '薄', '款', '清', '凉', '连', '衣', '裙', '子', '宝', '宝', '裙', '子']
entities:
['品 牌', '彼 得 兔']
text: ['背', '带', '牛', '仔', '裤', '阔', '腿', '裤', '印', '花', '拼', '接', '文', '艺', '森', '女', '复', '古', '范', '大', '码', '长', '裤', '2019', '春', '季', '新', '款']
entities:
['品 牌', '背 带']
['品 牌', '文 艺 森']
text: ['南', '极', '人', '男', '士', '睡', '衣', '夏', '季', '纯', '棉', '短', '袖', '长', '裤', '薄', '款', '宽', '松', '加', '肥', '加', '大', '码', '家', '居', '服', '男', '套', '装']
entities:
['品 牌', '南 极 人']
```

# 参考

> https://github.com/hackerxiaobai/OpenTag_2019