|
|
@@ -291,7 +291,7 @@ fastNLP提供了Trainer对象来组织训练过程,包括完成loss计算(所 |
|
|
|
|
|
|
|
|
|
|
|
PS: 使用Bert进行文本分类 |
|
|
|
~~~~~~~~~~~~~~~~~~~~ |
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
|
|
|
|
|
|
.. code-block:: python |
|
|
|
|
|
|
@@ -368,7 +368,7 @@ PS: 使用Bert进行文本分类 |
|
|
|
|
|
|
|
|
|
|
|
PS: 基于词进行文本分类 |
|
|
|
~~~~~~~~~~~~~~~~~~~~ |
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
|
|
|
|
|
|
由于汉字中没有显示的字与字的边界,一般需要通过分词器先将句子进行分词操作。 |
|
|
|
下面的例子演示了如何不基于fastNLP已有的数据读取、预处理代码进行文本分类。 |
|
|
|