Giter Club home page Giter Club logo

nlp's Introduction

Natural language processing(NLP) 프로젝트

개요

  • Pretrained language model(PLM)을 활용한 downstream task 수행

개발 환경

Windows 10 + RTX 3080 + CUDA 11.1 환경에서 수행함

Windows 10에서 torchtext >= 0.9 버전을 사용해야하므로 pytorch는 1.8.0 버전 사용 (pytorch, torchtext compatibility: https://pypi.org/project/torchtext/0.12.0/)

Lecture code에서 요구하는 버전 명시

  • Python 3.6 or higher (python 3.7 사용)
  • PyTorch 1.6 or higher
  • PyTorch Ignite
  • TorchText 0.5 or higher
  • torch-optimizer 0.0.1a15
  • Tokenized corpus (e.g. Moses, Mecab, Jieba)
  • Huggingface
$ pip install -r requirements.txt

Usage

$ cd PyTorch/lecture_code
$ mkdir saved_models
$ python finetune_plm_native.py --model ./saved_models/review.native.kcbert.pth --train_fn ./data/review.sorted.uniq.refined.shuf.train.tsv --gpu_id 0 --batch_size 80 --n_epochs 2
$ cat ./data/review.sorted.uniq.refined.shuf.test.tsv | shuf | head -n 20 | awk -F'\t' ' { print $2 } ' | python classify_plm.py --model_fn ./saved_models/review.native.kcbert.pth --gpu_id 0
$ python classify_plm.py --model_fn ./saved_models/review.native.kcbert.pth --data_fn ./data/review.sorted.uniq.refined.shuf.test.tsv --gpu_id 0 | awk -F'\t' '{ print $1 }' > ./saved_models/review.native.kcbert.pth.result.txt
$ cat ./data/review.sorted.uniq.refined.shuf.test.tsv | awk -F'\t' ' { print $1 } ' > ./saved_models/test_ground_truth.txt

Tips

  1. 맞춘 것도, 틀린 것도 시각화 등으로 한번 봐보자

Reference

nlp's People

Watchers

Jisoo Kim 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.