Carpe diem

NLP 관련 석사 과정 재학 중 (2022.03 ~ )

AI/Natural Language Processing 2

Bi-encoder, Cross-encoder, Poly-encoder (구현 실습)

※ 연구하면서 혼자 구현해본 내용이기에 틀린게 있을 수 있음 ※ 사용 데이터세트는 송영숙님의 챗봇 데이터 0. 사전 작업 1. Bi-encoder 2. Cross-encoder Cross-encoder는 Sentence Trasnforemr 라이브러리를 이용해 구현 3. Poly-encoder ** attention 연산을 위와 같이 작성하였더니, Poly-encoder 출력 값과 Bi-encoder 출력 결과가 동일하게 나와서 수정 ♣ 전체 코드 https://github.com/Jaedong95/Chatbot/tree/main/Encoder ♣ 참고 자료 [개념] https://ratsgo.github.io/nlpbook/docs/language_model/tr_self_attention/ [코드] ..

Bi-encoder, Cross-encoder, Poly-encoder (이론)

⊙ 해당 포스팅은 다른 분들이 작성한 내용을 최소한으로 요약 정리한 포스팅입니다. ⊙ 보다 자세한 내용 (수식 등)을 알고 싶으신 분들은 맨 아래 페이지의 참고 자료에 있는 사이트들을 참고해주세요. 0. Bi-encoder & Cross-encoder - pairwise comparison task 문제를 해결하기 위한 인코더 - 다음에 올 문장을 예측하는 등의 작업에 사용됨 - 두 인코더 모두 Cross-Entropy Loss를 최소화도록 학습함 1) Bi-encoder Context Encoder와 Candidate Encoder가 각각 context 문장과 해당 context 문장 다음에 올 후보 문장을 인코딩함 인코딩 결과로 Context Embedding(ctxt Emb), Candidate E..