์ž์—ฐ์–ด ์ฒ˜๋ฆฌ/Today I learned :

[์ž์—ฐ์–ด ์ฒ˜๋ฆฌ]์ „์ฒ˜๋ฆฌ ๋„์–ด์“ฐ๊ธฐ ๊ต์ • ์ˆ˜์ • PyKoSpacing ์˜ˆ์ œ

์ฃผ์˜ ๐Ÿฑ 2023. 1. 3. 18:23
728x90
๋ฐ˜์‘ํ˜•
!pip install git+https://github.com/haven-jeon/PyKoSpacing.git
sentence = '์ฝ”๋”ฉ๊ณผ AI ๊ฐœ๋ฐœ์ด ๋‘˜๋‹ค ๊ฐ€๋Šฅํ•œ ์‚ฌ๋žŒ์€ ๋งŽ์ง€ ์•Š๋‹ค.'
new = sentence.replace(" ", '') # ๋„์–ด์“ฐ๊ธฐ๊ฐ€ ์—†๋Š” ๋ฌธ์žฅ ์ž„์˜๋กœ ๋งŒ๋“ค๊ธฐ
print(new)
from pykospacing import Spacing
spacing = Spacing()
kospacing_sen = spacing(new) 

print('๋„์–ด์“ฐ๊ธฐ๊ฐ€ ์—†๋Š” ๋ฌธ์žฅ :\n', new) 
print('์ •๋‹ต ๋ฌธ์žฅ:\n', sentence) 
print('๋„์–ด์“ฐ๊ธฐ ๊ต์ • ํ›„:\n', kospacing_sen)

๋„์–ด์“ฐ๊ธฐ๊ฐ€ ์—†๋Š” ๋ฌธ์žฅ :
 ์ฝ”๋”ฉ๊ณผAI๊ฐœ๋ฐœ์ด๋‘˜๋‹ค๊ฐ€๋Šฅํ•œ์‚ฌ๋žŒ์€๋งŽ์ง€์•Š๋‹ค.
์ •๋‹ต ๋ฌธ์žฅ:
 ์ฝ”๋”ฉ๊ณผ AI ๊ฐœ๋ฐœ์ด ๋‘˜๋‹ค ๊ฐ€๋Šฅํ•œ ์‚ฌ๋žŒ์€ ๋งŽ์ง€ ์•Š๋‹ค.
๋„์–ด์“ฐ๊ธฐ ๊ต์ • ํ›„:
 ์ฝ”๋”ฉ๊ณผ AI ๊ฐœ๋ฐœ์ด ๋‘˜ ๋‹ค ๊ฐ€๋Šฅํ•œ ์‚ฌ๋žŒ์€ ๋งŽ์ง€ ์•Š๋‹ค.

๋ฐ˜์‘ํ˜•