from fastNLP.fastnlp import FastNLP def word_seg(): nlp = FastNLP("./data_for_tests/") nlp.load("seq_label_model") text = "这是最好的基于深度学习的中文分词系统。" result = nlp.run(text) print(result) print("FastNLP finished!") def text_class(): nlp = FastNLP("./data_for_tests/") nlp.load("text_class_model") text = "这是最好的基于深度学习的中文分词系统。" result = nlp.run(text) print(result) print("FastNLP finished!") if __name__ == "__main__": text_class()
一款轻量级的自然语言处理(NLP)工具包,目标是减少用户项目中的工程型代码,例如数据处理循环、训练循环、多卡运行等