如何为 NLP 分类器使用多个文本特征?

数据挖掘 机器学习 神经网络 深度学习 分类 nlp
2021-10-06 07:53:58

我正在尝试构建文本分类器,通常,我们有一个文本列和基本事实。但我正在研究一个数据集包含许多文本特征的问题。我正在探索如何利用不同的文本功能的不同方式。

例如,我的数据集如下所示

Index_no                   domain  comment_by   comment       research_paper      books_name

01                         Science  Professor   Thesis needs  Evolution of         MOIRCS 
                                                more work     Quiescent            Deep 
                                                              Galaxies as a        Survey
                                                              Function of
                                                              Stellar Mass       



02                         Math    Professor   Doesn't follow  Evolution of   
                                               Latex format   Quiescent           nonlinear 
                                                              Galaxies as a       dispersive
                                                              Function of         equations
                                                              Stellar Mass             

这只是一个虚拟数据集,这里我的基本事实 (Y) 是域,特征是comment_by, comment, research_paper,books_name

如果我使用任何 NLP 模型(RNN-LSTM、Transformers 等),这些模型通常采用一个 3 个暗向量,因为如果我使用一个有效的文本列,但是文本分类器有多少文本特征?

我试过的:

1)加入所有列并制作一个长字符串

Professor Thesis needs more work Evolution of Quiescent Galaxies as a Function of Stellar Mass MOIRCS Deep Survey  

2)在列之间使用标记

<CB> Professor <C> Thesis needs more work <R> Evolution of Quiescent Galaxies as a Function of Stellar Mass <B> MOIRCS Deep Survey 

其中<CB>comment_by、<C>comment、<R>research_paper、<B>books_name

我应该<CB>在开始时使用还是这样使用?

Professor <1> Thesis needs more work <2> Evolution of Quiescent Galaxies as a Function of Stellar Mass <3> MOIRCS Deep Survey

3)为每一列使用不同的密集层(或嵌入)并将它们连接起来。

我已经尝试了所有三种方法,还有其他方法可以尝试提高模型的准确性吗?还是提取、组合、加入更好的特征?

提前致谢!

1个回答

一种选择是将所有信息嵌入到一个空间中。嵌入空间将包含标记和特征名称。

通常会更改令牌以跟踪出处。例如,science__DOMAINprofessor__COMMENT_BY

执行此操作的包的一个示例是StarSpace