2021 09 28 - KR-HappyFace/meetup-logs GitHub Wiki

2021-09-28

๊ธฐํƒ€ ๋…ผ์˜์‚ฌํ•ญ

  • ๋ชฉ์š”์ผ์— ์•Œ๊ณ ๋ฆฌ์ฆ˜ vs ๋…ผ๋ฌธ๋ฆฌ๋ทฐ -> ์ผ๋‹จ ์•Œ๊ณ ๋ฆฌ์ฆ˜!
  • Github Remote <-> Upstage Server: ์—ฐ์ฃผ๋‹˜, ํ˜„์ˆ˜๋‹˜์€ ์ด๋ฏธ ํ•˜๊ณ  ์žˆ์Œ!

Embedding Size difference?

  • baseline code์—์„œ model roberta๋กœ ๋ฐ”๊ฟ”์„œ ๋Œ๋ ค๋ณด์‹ ๋ถ„ ๊ณ„์‹ ๊ฐ€์š”.. ์ฐจ์›์ˆ˜๊ฐ€ ์•ˆ๋งž์•„์„œ ์˜ค๋ฅ˜๊ฐ€ ๋œจ๋Š”๊ฑฐ๊ฐ™์€๋ฐ ์–ด๋–ค๋ถ€๋ถ„์„ ๊ณ ์ณ์•ผํ• ์ง€ ๊ฐ์ด ์•ˆ์˜ค๋„ค์š”;;
  • ์ฝ”๋“œ๋Š” ์ œ๊ณต๋œ ์ฝ”๋“œ์—์„œ MODEL_NAME = "klue/roberta-large" ์ด ๋ถ€๋ถ„๋งŒ ๋ฐ”๊ฟจ๋Š”๋ฐ ์‚ฌ์ง„๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋œจ๋„ค์š” ใ… ใ…  ๋ฒ„ํŠธ ๋ฒ ์ด์Šค๋Š” ์ž˜ ๋˜๋Š”๋ฐ ๋กœ๋ฒ„ํƒ€ base๋„ ์•ˆ๋˜๋”๋ผ๊ตฌ์š” ใ…Žใ…Ž... ์ด๊ฒŒ ๋ฌด์Šจ ๋ฌธ์ œ์ธ์ง€ ์กฐ๊ธˆ ๋” ์ฒœ์ฒœํžˆ ๋œฏ์–ด๊ฐ€๋ฉด์„œ ๊ณต๋ถ€ํ•ด์•ผ๊ฒ ์Šต๋‹ˆ๋‹คใ… ใ… 

์“ฐ๋ ˆ๊ธฐํ†ต ๋น„์šฐ๋Š” ๋ช…๋ น์–ด

rm -rf ~/.local/share/Trash/* ์ถœ์ฒ˜: https://askubuntu.com/questions/468721/how-can-i-empty-the-trash-using-terminal

Adding Semicolon for specifal tokens or not

  • ALBERT
    • semicolon์„ ๋„ฃ์–ด์•ผ ํ•˜๋‚˜ ๋งˆ๋‚˜? '[SEP]'์œผ๋กœ ๋„ฃ์–ด์•ผ ํ•˜๋‚˜ ์•„๋‹ˆ๋ฉด [SEP]๋กœ ๋„ฃ์–ด์•ผ ํ•˜๋‚˜.

Divide Label?

๋ผ๋ฒจ์ด ์ด 30๊ฐœ: type ๊ฐ„์˜ ๊ด€๊ณ„๋“ค๋กœ ๋ผ๋ฒจ์ด ๋˜๋”๋ผ๊ณ ์š”.

  • Special token์„ ์ง์ ‘ ์ถ”๊ฐ€ํ•˜๋“ฏ์ด ๋“ฑ์œผ๋กœ Replaceํ•ด์„œ ๋„ฃ์—ˆ๋Š”๋ฐ ์„ฑ๋Šฅ์ด ์ข‹์•„์ง€์ง„ ์•Š์•˜๋‹ค.
  • type์˜ ์กฐํ•ฉ์œผ๋กœ ๋‚˜์˜ฌ ์ˆ˜ ์žˆ๋Š” ๊ฒŒ ๋ช‡ ์—†๋”๋ผ๊ณ ์š”.
  • ์˜ˆ๋ฅผ ๋“ค์–ด์„œ subjectํ•˜๊ณ  object์˜ ๊ด€๊ณ„๊ฐ€ organization์ด ํ•ด์ฒดํ•œ ๋‚ ์งœ์˜€๊ฑฐ๋“ ์š”.
  • ๋ชจ๋ธ ๋ผ๋ฒจ ๊ฒฐ๊ณผ๊ฐ’์„ ์ชผ๊ฐค ์ˆ˜ ์žˆ๋Š”๊ฐ€?: ๋ผ๋ฒจ ์ชผ๊ฐœ๋Š” ๋ฐฉ์‹์€ ์ž˜ ๋ชจ๋ฅด๊ฒ ์Œ. ๋น„ํ‹€์ฆˆ, ์กฐ์ง€ ํ•ด๋ฆฌ์Šจ ๊ด€๊ณ„๋ฅผ ํŒŒ์•…ํ•ด์•ผ ํ•˜์ž–์•„์š”.
  • ๋น„ํ‹€ ##์ฆˆ์ฒ˜๋Ÿผ ๋‚˜๋‰˜๋Š” ๊ฒŒ ์•ˆ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์„œ type ๋ณ„๋กœ ๋ฐ”๊ฟจ๋Š”๋ฐ, ๊ทธ๋ ‡๊ฒŒ ์ž˜ ๋‚˜์˜ค์ง€๋Š” ์•Š๋”๋ผ๊ณ ์š”.

PHO๊ฐ€ ๋ญ์ง€?

  • ๊ธฐํƒ€๊ณ ์œ ๋ช…์‚ฌ์ธ ๋“ฏ

Data Imbalance

  • ์ €๋ฒˆ Pstage ๋•Œ๋Š” Crossentropy loss์— class weights๋ฅผ ๋ถ€์—ฌ๋ฅผ ํ–ˆ๊ฑฐ๋“ ์š”. ๊ทธ๊ฑฐ๋ฅผ ํ–ˆ์„ ๋•Œ๋ž‘ ์•ˆ ํ–ˆ์„ ๋•Œ๋Š” ๋น„๊ต๋ฅผ ์•ˆ ํ•ด๋ดค๊ณ . ๊ทธ๊ฑธ ํ–ˆ์„ ๋•Œ ์„ฑ๋Šฅ์ด ์ž˜ ๋‚˜์˜ค์ง€๋Š” ์•Š๋”๋ผ. Albert ๋ชจ๋ธ์˜ ๋ฌธ์ œ์ธ ๊ฑด์ง€ ์ž˜ ๋ชจ๋ฅด๊ฒ ์Œ. Class weight๋ฅผ ํ•˜๋Š” ๊ฒŒ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”?
  • Class weight ๋„ฃ๋Š” ๋ฐฉ์‹์ด ์—ฌ๋Ÿฌ ๊ฐ€์ง€๊ฐ€ ์žˆ๋Š”๋ฐ. ๊ทธ๊ฑธ ์‹œ๋„ํ•ด๋ด์•ผ๊ฒ ๋‹ค๋Š” ์ƒ๊ฐ์„ ํ•˜๊ณ  ์žˆ์–ด์„œ. Focal loss weight ๋„ฃ๋Š” ๊ฑฐ๋ž‘ class weight ๋„ฃ๋Š” ๊ฑฐ๋ž‘ ๋‹ค๋ฅธ๊ฐ€ ์‹ถ๊ธฐ๋„ ํ•˜๊ณ .
  • Trainer์— class weight์„ ๋„ฃ๋Š” ๋ฐฉ์‹์„ ๋ชฐ๋ผ์„œ ์‚ฝ์งˆ์„ ํ–ˆ๋Š”๋ฐ. ๊ฒฐ๊ตญ ์ฐพ์•˜๊ฑฐ๋“ ์š”! Trainer์—์„œ ์ƒ์†๋ฐ›์•„์„œ compute_loss๋กœ overwrite์„ ํ–ˆ๋‹ค.
  • Focal loss์— EDAํ•œ class weight์œผ๋กœ ๋„ฃ๋Š” ๊ฒƒ๋„ ์ข‹์„ ๋“ฏ ํ•˜๋‹ค.

tokenizer error

ValueError: Couldn't instantiate the backend tokenizer from one of: 
(1) a `tokenizers` library serialization file, 
(2) a slow tokenizer instance to convert or 
(3) an equivalent slow tokenizer class to instantiate and convert.

token_type_ids๊ฐ€ ๋„๋Œ€์ฒด ๋ญ˜๊นŒ?

input_id, token_id, attention_mask, labels ๋”•์…”๋„ˆ๋ฆฌ๋กœ ๋‚˜์˜ค์ž–์•„์š”?

  • object๋ž‘ ์›๋ž˜ ๋ฌธ์žฅ์ด๋ž‘ 0,1๋กœ binary๋กœ context๋ฅผ ๊ตฌ๋ถ„ํ•˜๋Š” ๋“ฏ ํ•˜๋‹ค.

๋””๋ฒ„๊น…ํ•˜๋Š” ๊ฟ€ํŒ

  • CUDA ์—๋Ÿฌ๋Š” low-level ์—๋Ÿฌ๋ผ์„œ .to_device()๋ฅผ GPU ๋Œ€์‹ ์— CPU๋กœ ํ•˜๋ฉด ์ข€ ๋” ํ•˜์ด๋ ˆ๋ฒจ ์—๋Ÿฌ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
โš ๏ธ **GitHub.com Fallback** โš ๏ธ