Code Monkey home page Code Monkey logo

TAJO chatbot๐Ÿ“š

Table of Contents

ํ”„๋กœ์ ํŠธ ์†Œ๊ฐœ โœจ

Open Domain Question Answering

  • ODQA ๋Š” ์ฃผ์–ด์ง„ ์งˆ๋ฌธ์— ์ ์ ˆํ•œ ๋‹ต์„ ์ฐพ๋Š” ๊ณผ์ •์ด๋ฉฐ,Retriever, Reader ๋‘ ๋‹จ๊ณ„๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๋จผ์ € ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๋‹ต์„ ํ’ˆ๊ณ  ์žˆ๋Š” ์ง€๋ฌธ์„ ๊ฒ€์ƒ‰ํ•˜๋Š” Retriver ๊ณผ์ •์„ ๊ฑฐ์น˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
  • ์ดํ›„ ํ•ด๋‹น ์ง€๋ฌธ ์† ์ •๋‹ต์„ ์ฐพ๋Š” Reader ๊ณผ์ •์„ ํ†ตํ•ด ์ตœ์ข… ์•„์›ƒํ’‹์„ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์š”๊ตฌ ์‚ฌํ•ญ ๐Ÿš€

!pip install datasets
!pip install transformers
!pip install elasticsearch
!pip install pororo

# Mecab ์„ค์น˜
!sudo apt-get install g++ openjdk-8-jdk python3-dev python3-pip curl
!python3 -m pip install --upgrade pip
!python3 -m pip install konlpy
!sudo apt-get install curl git
!bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)

# Haystack ์„ค์น˜
!pip install git+https://github.com/deepset-ai/haystack.git

ํŒŒ์ผ ๊ตฌ์„ฑ

|-- dpr  # Retriever
|   |-- dpr_train.py
|   |-- korquad_preprocess.py
|   `-- squad_to_dpr.py
|-- mrc  # Reader
|   |-- tag_compound
|   |   |-- __init__.py
|   |   |-- data
|   |   |   |-- tag_train.tsv
|   |   |   |-- tag_train_augmented.tsv
|   |   |   `-- tag_valid.tsv
|   |   |-- inference.py
|   |   |-- load_data.py
|   |   |-- tag_compound.py
|   |   |-- tag_inference.py
|   |   `-- train.py
|   |-- arguments.py
|   |-- customAddedConv.py
|   |-- train.py
|   |-- trainer_qa.py
|   `-- utils_qa.py
`-- readme.md

Retriever ํ•™์Šต ๋ฐ ํ‰๊ฐ€

๋ฐ์ดํ„ฐ

  • Retriver ํ•™์Šต ๋ฐ์ดํ„ฐ : wikipedia๊ธฐ๋ฐ˜ QA ๋ฐ์ดํ„ฐ์…‹(KorQuAD 1.0, AI hub ๊ธฐ๊ณ„ ๋…ํ•ด)

ํ•™์Šต ๋ฐ ์ถ”๋ก 

  • korquad_preprocess.ipynb ์‹คํ–‰
    • KorQuAD 1.0, AI hub ๋ฐ์ดํ„ฐ ์…‹์„ ํ•ฉ์น˜๊ณ  DPR ํ•™์Šต์— ๋งž๋„๋ก positive-negative pair dataset ๊ตฌ์„ฑ
    • ๊ฐ query๋งˆ๋‹ค Elasticsearch๋ฅผ ์ด์šฉํ•ด์„œ negative sample์„ 16๊ฐœ์”ฉ ์ƒ์„ฑ
python dpr_train.py

Reader(MRC) ํ•™์Šต ๋ฐ ํ‰๊ฐ€

๋ฐ์ดํ„ฐ

  • MRC ํ•™์Šต ๋ฐ์ดํ„ฐ : KLUE MRC Dataset

ํ•™์Šต ๋ฐ ์ถ”๋ก 

train.py ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด mrc ๋ชจ๋ธ์˜ ํ•™์Šต์ด ์ง„ํ–‰๋ฉ๋‹ˆ๋‹ค.

cd ./mrc
# ํ•™์Šต ์˜ˆ์‹œ (ํ•™์Šต ์ค‘ validation ์„ ๋™์‹œ์— ํ•˜๋ ค๋ฉด --do_eval ์ถ”๊ฐ€)
python train.py --output_dir [path to save trained model] --do_train
# ์ถ”๋ก  ์˜ˆ์‹œ
python train.py --model_name_or_path [path to load trained model] --do_eval

Inference

Demo-site

Contributor

๊น€๋‚จํ˜_T1014 ์„œ์ผ_T1093 ์—„ํฌ์ค€_T1122 ์šฐ์ข…๋นˆ_T1129 ์ด๋ณดํ˜„_T1148 ์žฅ๋ณด์œค_T1178
55614265 46472729 50470448 44800643 50580028 45453533

TAJO Chatbot's Projects

odqa-team-tajo icon odqa-team-tajo

๋„ค์ด๋ฒ„ ๋ถ€์ŠคํŠธ ์บ ํ”„ AI TECH, P3 MRC Project

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.