Giter Site home page Giter Site logo

nlp-lab2-opinon-mining's Introduction

实验二:电商评论观点挖掘

实验基本情况

小组成员

1173710132 牟虹霖 1173710217 侯鹏钰

组内分数分配

牟虹霖 1 侯鹏钰 0.95

编码要求

本次实验采用UTF-8编码

运行所需库(根目录下含requirements.txt)

paddlehub==1.3.0 paddlepaddle==1.5.1 pkuseg==0.0.22 pyltp==0.2.1 python-crfsuite==0.9.6 sklearn==0.0 sklearn-crfsuite==0.3.6 synonyms==3.10.2

代码文件说明

实验文件结构

C:.
├─属性分类
│  └─ERNIE
│      ├─data
│      └─results
├─属性词情感词抽取
│  ├─BiGRU-CRF
│  │  ├─data
│  │  ├─model_
│  │  │  └─epoch99
│  │  └─results
│  ├─CRF
│  │  ├─seg_crf
│  │  │  ├─data
│  │  │  ├─results
│  │  │  └─utils
│  │  └─word_crf
│  │      ├─data
│  │      ├─results
│  │      └─utils
│  └─ERNIE
│      ├─ERNIE_etract
│      │  └─data
│      └─ERNIE_mapping
│          ├─data
│          │  └─.ipynb_checkpoints
│          └─results
└─观点极性分类
    └─ERNIE
        ├─data
        └─results

项目运行方法

属性词情感词抽取任务——CRF方法

(注:基于字、词的CRF方法运行方法均相同)

运行python extract_crf.py指令训练CRF模型

运行python fo_mapping.py可于 results 文件夹下生成指令生成 task1_answer.csv

属性词情感词抽取任务——BiGRU-CRF方法

运行python gen_feature_sents.py指令可于 data 文件夹下生成训练所需的数据

运行python train.py指令可运行训练模型代码(注:该文件夹已保存一份模型可直接使用)

运行python test.py指令可于 results 文件夹下生成 temp_out.txt 为测试中间结果

运行python fo_mapping.py指令可于 results 文件夹下生成 task1_answer.csv 文件

属性词情感词抽取任务——ERNIE方法

通过命令行终端进入 属性词情感词抽取/ERNIE/ERNIE_extract 文件夹

运行sh run_sequence_label.sh指令即运行模型训练任务

运行sh run_predict.sh指令即运行模型的预测任务,可于 results 文件夹下生成temp_out.txt文件

将 temp_out.txt 移动至 属性词情感词抽取/ERNIE/ERNIE_mapping/data 文件夹

通过命令行终端进入 属性词情感词抽取/ERNIE/ERNIE_mapping 文件夹

运行sh run_classifer.sh指令即运行模型训练任务

运行sh run_predict.sh指令即运行模型的预测任务,可于 results 文件夹下生成 task1_answer.csv 文件

属性分类任务——ERNIE方法

运行sh run_classifer.sh指令即运行模型训练任务

运行sh run_predict.sh指令即运行模型的预测任务,可于 results 文件夹下生成 task2_answer.csv 文件

观点极性分类任务——ERNIE方法

运行sh run_classifer.sh指令即运行模型训练任务

运行sh run_predict.sh指令即运行模型的预测任务,可于 results 文件夹下生成 task3_answer.csv 文件

nlp-lab2-opinon-mining's People

Contributors

hlmu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.