如何将多个文本特征用于 NLP 分类器?

Aad*_*Ura 6 nlp machine-learning neural-network deep-learning keras

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

例如,我的数据集看起来像这样

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             
Run Code Online (Sandbox Code Playgroud)

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

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

我试过的:

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

教授论文需要更多的工作 静止星系的演化作为恒星质量 MOIRCS 深度巡天的函数

2)在列之间使用标记

<CB> Professor <C> Thesis needs more work <R> Evolution of Quiescent Galaxies as a Function of Stellar Mass <B> MOIRCS Deep Survey 
Run Code Online (Sandbox Code Playgroud)

其中<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
Run Code Online (Sandbox Code Playgroud)

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

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

提前致谢!

spe*_*tre 1

您可以尝试以下一些操作:

1.) 将research_paper,book_name和组合comment成一个字符串。

2.) 将其视为comment_by分类变量并使用一个热编码器或标签编码器对其进行编码。

3.) 无论您使用什么模型,调整超参数以改善结果。

请让我知道你得到的结果!