Giter Site home page Giter Site logo

zhengyima / ncov_sentiment Goto Github PK

View Code? Open in Web Editor NEW
35.0 3.0 9.0 109 KB

疫情期间网民情绪识别比赛baseline,使用BERT进行端到端的fine-tuning,datafountain平台,平台评测F1值0.716。

Python 76.25% Shell 0.42% Jupyter Notebook 23.33%
tensorflow bert fine-tuning nlp python sentiment-analysis sentiment-classification bert-chinese deep-learning datafountain

ncov_sentiment's Introduction

NCOV_Sentiment

NCOV_Sentiment Source Code

疫情期间网民情绪识别比赛baseline,使用BERT进行端到端的fine-tuning,平台评测F1值0.716。

很基础的基线,只用了labeled数据,没有利用unlabeled数据,没有调参。

Preinstallation

Before launch the script install these packages in your Python3 environment:

  • tensorflow 1.11

建议使用Conda安装 :)

 conda create -n tf1.11 python=3.6 tensorflow=1.11 tensorflow-gpu=1.11
 conda activate tf1.11

下载Bert中文模型至本地,并更改bert/run.sh中的BERT_BASE_DIR路径。

在datafountain平台上下载数据,解压至本地目录。将数据由gbk转为utf-8编码(vscode或linux shell的iconv命令)

运行数据预处理脚本dataprocess/data_process.py,将数据处理成bert的输入格式。(注意更改代码中的输出路径,并保持输出路径与bert/run.sh中的NCOV_DIR路径一致。

 python dataprocess/data_process.py

更改bert/run.sh中的OUTPUT_DIR路径为模型及结果输出路径。

Launch the script

环境配好,模型下好之后便可以运行代码了!

 bash bert/run.sh

Links

ncov_sentiment's People

Contributors

zhengyima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ncov_sentiment's Issues

提示错误

我使用了一个gpu 2070s 但是最后提示错误
tensorflow.python.framework.errors_impl.ResourceExhaustedError: 2 root error(s) found.
image
查了下,说是因为我资源耗尽了
emmmm,想问下楼主,你用的gpu情况,你的这个代码,我跑不起来了,【捂脸,尴尬】

此外,那个gen_res.py文件是做什么的啊

非常感谢楼主分享

内存溢出

你好,我遇到了内存溢出问题,然后修改了batch_size就可以了,但是,要运行很久,想问下,你运行这个代码要运行多久才结束的哈,是不是运行完毕后,才可以产生test_result.tsv文件哈?

谢谢

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.