Comments (15)
多标签分类的模型还没有增加,可以提供详细的数据集链接,我会看情况增加相关任务。
from kashgari.
@BrikerMan 这是数据集链接 链接:https://pan.baidu.com/s/1spbM8QuyjRmgCSa9i-P7Mw
提取码:679y
只有7天有效哦
from kashgari.
这个问题并不是单个维度的多标签,感觉需要专门建模处理才可以,我这里能支持的是 [(1, 2), (3,4),(5,)]
这种简单的多标签多分类。
from kashgari.
这样的多分类能满足需求嘛,y 是由多个标签组成的~
from kashgari.
A multi label classification problem could be solved by training a model with sigmoid
as activation function and binary-crossentropy
as loss function. The output is an n-dim one-hot vector to predict n possible labels.
That's it.
from kashgari.
@alexwwang @Owenscu check this #29 out, is this looks good to you? I am planning to add multi_label classification, but it seems we had to change all the classification models to support this feature.
Dataset is from http://tcci.ccf.org.cn/conference/2018/taskdata.php task 1.
from kashgari.
Is it possible to wrap up a given nn models in a multi-label task model? I mean just replace the last output layer to fit with different kind of classification tasks and allow users to determine which to choose.
Meanwhile I am considering allowing users setting hyper_parameters while initializing a model class in the model zoo.
I think these two aspects could be put together, so the flexibility and concision could both be kept.
from kashgari.
I think your solution is better than mine, please make the changes and submit a pull request~ @alexwwang
from kashgari.
Ok but I'm afraid it would take some time. Fighting the shape bug yet.
from kashgari.
Take your time, no need to rush.
from kashgari.
#34 This commit fulfilled this need. By passing sigmoid
and binary_crossentropy
hyper_parameters to init function of a classification model, you could get one model support multi-label vector output.
from kashgari.
@alexwwang I think multi-label is not finished yet, still need to change here
to process multi_label.from kashgari.
@BrikerMan Yeah, the data padding work. The nearest approach, I think, maybe with the help of sklearn.preprocessing.MultiLabelBinarizer. And this tool could also deal with multi-class classification as a specific type of multi-label classification. Or just add up another switch to approach multi-label y-vector, leaving current part unchanged.
Whatever, seems there's no shortcut here in data preprocessing and prediction processing, if we want to keep the predict confidence/probability of each label/class.
How do you think?
from kashgari.
Please check out the #29, I have used sklearn.preprocessing.MultiLabelBinarizer
and rewrite the data-process and predict function.
from kashgari.
Kashgari supported multi-label classification now, change y from string to a string list, then set multi_label=True
While init model class.
from kashgari.
Related Issues (20)
- ner任务 tf_serving 调用问题
- [Question] 请问这个错误如何解决? HOT 2
- [Question] Can i adjust the learning rate of CRF? HOT 1
- [Question] labeling模型进行推理时随次数的增加而进程占用的内存逐渐增多,是否存在内存内存泄漏现象? HOT 2
- [Question] How to adjust learning rate when I use Bi-LSTM model on classification task? HOT 2
- [Question] 关于继续学习添加新的实体 HOT 2
- 使用albert做嵌入的时候报错 HOT 1
- 导入BERTEmbedding失败 HOT 2
- [Question] 文本分类中的CNN开头的模型accuracy不管换数据集还是调参数都只有0.2 HOT 1
- [Question] 使用keras导入RAdam时报错 HOT 1
- [Question] https://eliyar.biz/ can't open HOT 2
- ner: cnn+lstm and bigru mod ,The code is the same HOT 1
- [Question] 如何在GPU上进行训练
- [BUG] BiLSTM_Model.load_model('saved_ner_model')源代码加载模型报错 HOT 1
- [Question] HOT 1
- [BUG] 自定义模型,多个特征输入使用多个embed,模型fit报错,还需要重定义哪些方法来支持? HOT 2
- 简单调用BiLSTM_CRF模型,使用最基本bert-chinese作为embedding,运行报错layer_crf does not support masking HOT 1
- Got 'Blas xGEMMBatched launch failed' using BERT + BiLSTM
- Columns and DataType Not Explicitly Set on line 77 of classifications.py
- [Question] NER任务,使用load_model.predict()方法进行标签预测时,若句子长度超过128会被截断,应该如何处理。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kashgari.