다음은 ‘bill’과 유사한 단어의 리스트를 반환한 결과입니다.

    [('legislation', 0.8072139620780945),
     ('proposal', 0.730686366558075),
     ('senate', 0.7142541408538818),
     ('bills', 0.704440176486969),
     ('measure', 0.6958035230636597),
     ('passed', 0.690624475479126),
     ('amendment', 0.6846879720687866),
     ('provision', 0.6845567226409912),
     ('plan', 0.6816462874412537),
     ('clinton', 0.6663140058517456)]

    ‘clinton’이라는 이름도 보이네요. 재미있는 결과입니다.

    이번에는 ‘cherry’라는 단어와 유사한 단어의 리스트를 보여 주는 코드를 작성해 보겠습니다.

    코드 10-19 ‘cherry’와 유사한 단어의 리스트를 반환

    model.most_similar('cherry') ------ 단어(cherry) 기준으로 가장 유사한 단어들의 리스트를 보여 줍니다.

    다음은 ‘cherry’와 유사한 단어의 리스트를 반환한 결과입니다.

    [('peach', 0.688809871673584),
     ('mango', 0.683819055557251),
     ('plum', 0.6684104204177856),
     ('berry', 0.6590359210968018),
     ('grove', 0.658155083656311),
     ('blossom', 0.6503506302833557),
     ('raspberry', 0.6477391719818115),
     ('strawberry', 0.6442098021507263),
     ('pine', 0.6390928626060486),
     ('almond', 0.6379212737083435)]
    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.