Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Improve MRC inference and change output #61

Closed
wants to merge 3 commits into from

Conversation

skaurl
Copy link

@skaurl skaurl commented Jun 2, 2021

Title

  • Improve MRC inference and change output

Summary

  • Predict span using top10 start&end position
  • Add score output
  • Add logit output

Description

In predicting span in the MRC, the existing code used only the maximum value of start position and end position. For a more accurate inference, the top 10 start positions and end positions were used to predict the highest score span. At this time, the score is defined as the sum of start logit and end logit.
Finally, I added logit and score to the output for user convenience.

Examples

>>> mrc = Pororo(task="mrc", lang="ko")
>>> mrc(
>>>    "카카오브레인이 공개한 것은?",
>>>    "카카오 인공지능(AI) 연구개발 자회사 카카오브레인이 AI 솔루션을 첫 상품화했다. 카카오는 카카오브레인 '포즈(pose·자세분석) API'를 유료 공개한다고 24일 밝혔다. 카카오브레인이 AI 기술을 유료 API를 공개하는 것은 처음이다. 공개하자마자 외부 문의가 쇄도한다. 포즈는 AI 비전(VISION, 영상·화면분석) 분야 중 하나다. 카카오브레인 포즈 API는 이미지나 영상을 분석해 사람 자세를 추출하는 기능을 제공한다."
>>> )
('포즈(pose·자세분석) API',
 (33, 44),
 (5.7833147048950195, 4.649877548217773),
 10.433192253112793)
>>> # when mecab doesn't work well for postprocess, you can set `postprocess` option as `False`
>>> mrc("카카오브레인이 공개한 라이브러리 이름은?", "카카오브레인은 자연어 처리와 음성 관련 태스크를 쉽게 수행할 수 있도록 도와 주는 라이브러리 pororo를 공개하였습니다.", postprocess=False)
('pororo', (31, 35), (8.656489372253418, 8.14583683013916), 16.802326202392578)

@skaurl skaurl closed this Jun 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant