๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ฌธ์žฅ ์žฌ๊ตฌ์„ฑ1

[Data Processing] ๋ฌธ์žฅ ์žฌ๊ตฌ์„ฑ์„ ํ†ตํ•œ ๋ฐ์ดํ„ฐ ์ฆ๊ฐ•(Data Augmentation) ์Šคํฌ๋ฆฝํŠธ ์ž‘์„ฑ ๐ŸŒจ๏ธ ๋ฌธ์žฅ ์žฌ๊ตฌ์„ฑ ๊ธฐ๋ฒ•์„ ์‚ฌ์šฉํ•œ ๋ฐ์ดํ„ฐ ์ฆ๊ฐ• ์Šคํฌ๋ฆฝํŠธ 1๏ธโƒฃ random ๋ชจ๋“ˆ ๊ฐ€์ ธ์˜ค๊ธฐ + ๋ฌธ์žฅ ์žฌ๊ตฌ์„ฑ ํ•จ์ˆ˜ sentence_rearrangement ๊ตฌํ˜„ import random def sentence_rearrangement(sentence): words = sentence.split() # ๋ฌธ์žฅ์„ ๋‹จ์–ด๋กœ ๋ถ„๋ฆฌ random.shuffle(words) # ๋‹จ์–ด์˜ ์ˆœ์„œ๋ฅผ ๋ฌด์ž‘์œ„๋กœ ์„ž์Œ new_sentence = ' '.join(words) # ๋‹จ์–ด๋“ค์„ ๋‹ค์‹œ ๋ฌธ์žฅ์œผ๋กœ ์กฐํ•ฉ return new_sentence โ€ป random ๋ชจ๋“ˆ์ด๋ž€? random ๋ชจ๋“ˆ์€ ํŒŒ์ด์ฌ์—์„œ ์ œ๊ณตํ•˜๋Š” ๋‚ด์žฅ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ, ๋‚œ์ˆ˜ ์ƒ์„ฑ ๋ฐ ๊ด€๋ฆฌ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•œ๋‹ค. ์ด ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์–‘ํ•œ ๋‚œ์ˆ˜ ์ƒ์„ฑ๊ณผ ๋ฌด์ž‘์œ„ ์š”์†Œ ์„ ํƒ, ์‹œํ€€์Šค ์„ž๊ธฐ ๋“ฑ ๋‹ค.. 2023. 7. 13.