Website โข Dependency โข Features โข Contributors โข License โข Reference
๋ณธ ํ๋ก์ ํธ๋ 2021 Ajou University Spring SW Capston Design ๊ณผ๋ชฉ์ ์ผํ์ผ๋ก ์งํ๋์์ต๋๋ค.
ํด๋น repository๋ ์ฐพ์๋ด์ ์ NLP ์์ค์ฝ๋๋ฅผ ์ ์ฅํ๊ณ ์์ต๋๋ค.
์์
์ ๋ชฉ์ ์ ๋๊ณ ์์ง ์์ผ๋ฉฐ, ํ APC์ ์ํด ๊ฐ๋ฐ๋์์ต๋๋ค.
๐2021๋ ํ๊ตญ๋์งํธ์ฝ๏ฟฝ๏ฟฝ๏ฟฝ์ธ ํํ ๋ํ์ ๋ ผ๋ฌธ๊ฒฝ์ง๋ํ ๊ธ์ ์์๐
Visit out website FindU ๐
FindU-NLP is based on torch=1.8.1(cuda 11.1) and python 3.8
์์ธํ dependency๋ requirements๋ฅผ ์ฐธ๊ณ ํ์๊ธฐ ๋ฐ๋๋๋ค.
์ฐพ์๋ด์ ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด์๋ ์์์ script๊ฐ ํ์ํ๋ค. ํ์ง๋ง ์ ํ๋ธ์์๋ script๊ฐ ์๋ ์์์ด ๋ง๊ณ '์๋ง ์๋ ์์ฑ ๊ธฐ๋ฅ'์ด ์์ง๋ง ํ๊ตญ์ด์ ๊ฒฝ์ฐ ์ ๋๋ก ์๋ง ์์ฑ์ด ์ด๋ฃจ์ด์ง์ง ์์ ํ๊ตญ์ด์ ๋ง๋ STT model์ ์ ์ํ์ฌ ์ฌ์ฉํ๊ณ ์ ํ๋ค.
| Dataset | AIHub |
| Model | DeepSpeech2 |
| Period | Iteration 1~3 |
| Model path | 'STT/models/ds2.pt' |
from STT import load_stt_model, stt
stt_model, stt_vocab = load_stt_model() # model๊ณผ vocab์ ์๋ฒ๊ฐ ์์ํ ๋ load
audio_path = 'your/audio_path/origin_audio.wav'
sentences = stt(stt_model, stt_vocab, audio_path) # sentences๋ list๋ก (์๊ฐ, ์๋ง)์ผ๋ก ๊ตฌ์ฑ
>> sentences[0] = (3.2, "๋ฒ์ญ๋ ์๋ง์ด ์ถ๋ ฅ๋ฉ๋๋ค.")ํด๋น ํค์๋๊ฐ ๋์์์ ์ด๋ค ๊ตฌ๊ฐ์ ์๋์ง ์ฐพ์์ค๋ค. ํค์๋๋ฅผ ์ ๋ ฅํ๋ฉด ํค์๋๊ฐ ์ํด์๋ ๋์ฌ๊ฐ ์์ํ๋ ์๊ฐ์ ๋ฆฌ์คํธํ์์ผ๋ก returnํ๋ค.
from basefunction import ctrl_f
SearchingValue = input("keyword:")
timestamp = ctrl_f(SearchingValue, json_file)
>>> ['00','00', ...] # SearchingValue์ ์์ ์์์๊ฐ return์์์ ์ ๋ชฉ๊ณผ ๋ด์ฉ์ ๊ธฐ๋ฐ์ผ๋ก ์ผ๋ง๋ ์ฐ๊ด์ฑ์ด ๋์์ง ์์น๋ก ๋ณด์ฌ์ค๋ค. ์ ๋ชฉ sentence vector์ ๋ด์ฉ sentence vector๋ฅผ cos-similarity๋ก ๊ณ์ฐํ์ฌ ์์์ ์ ๋ขฐ๋๊ธฐ๋ฅ์ ์ ๊ณตํ๋ค. ์ ๋ขฐ๋์ ๋ฒ์๋ 0~10์ด๋ค.
from wordembedding import cosin_similar
model = load_wm_model() # word embedding model์ ์๋ฒ๊ฐ ์์ํ ๋ load
SearchingValue = input("keyword:")
score = cosin_similar(SearchingValue, json_file, model)
>>> 0.3ํด๋น ํค์๋์ ํค์๋์ ์ฐ์๋จ์ด๊ฐ ๋์์์ ์ด๋ค ๊ตฌ๊ฐ์ ์๋์ง ์ฐพ์์ค๋ค.
from wordembedding import association_f
model = load_wm_model() # word embedding model์ ์๋ฒ๊ฐ ์์ํ ๋ load
SearchingValue = input("keyword:")
association_f(SearchingValue, json_file, model)
>>> ['00','00', ...] # SearchingValue์ ์์ ํ์์คํฌํ์ SearchingValue์ ์ฐ์๋จ์ด๊ฐ ํด๋นํ๋ ์์ ํ์์คํฌํ return์ฌ์ฉ์๊ฐ ๋ ์ธ๊ฐ์ ์ธ ์ง๋ฌธ์ ๋์ง๊ณ ์ด์ ํด๋นํ๋ ๋ต๋ณ์ ์ฐพ์ ์ ์๋ค.
| Dataset | KoQuAD1.0, KoQuAD2.0 |
| Model | bert-multilingual |
| Period | Iteration 20 |
| Model path | 'QA/models/*' |
from QA import load_qa_model, QA_system
qa_model, qa_tokenizer = load_qa_model() # model๊ณผ tokenizer๋ ์๋ฒ๊ฐ ์์ํ ๋ load
question = 'Your Question'
answers = QA_system(qa_model, qa_tokenizer, question, json_script) # answers๋ list๋ก (index, ๋ต๋ณ)์ผ๋ก ๊ตฌ์ฑ, index๋ ํด๋น ๋ต๋ณ์ด ์ถํํ๋ script์ index
>> (index, "๋ต๋ณ")์ ์ฒด ์คํฌ๋ฆฝํธ์ 3์ค์ ๋ ๋ถ๋์ ์์ฝํด์ ๋ณด์ฌ์ค๋ค.
from Summarization import load_sc_model, summary_script
from pororo import Pororo
summ_model = load_sc_model()
summarized_texts = summary_script(json_file, summ_model)
>>> "Text.Text.Text."Maintainer : ๋จํฌ์, ์ค์น๋ฏผ
Contributor : ๊ฐํ๊ฒฐ, ๊น์์ฐ, ํ๋ฒ์
FindU-NLP project is licensed under the terms of the Apache License 2.0.