difference between similar() and concordance in nltk

前端 未结 5 1904
夕颜
夕颜 2021-01-01 02:33

I have read the text1.similar(\"monstrous\") and text1.concordance(\"monstrous\") from this.

Where I couldn\'t get the satisfactory answer for the difference betwee

5条回答
  •  感情败类
    2021-01-01 02:51

    Concordance(token) provides you with the context in which a token is used. Similar(token) provides you with other words that appear in similar contexts.

    To illustrate, here a more general description to approximate their functionality.

    1) Concordance(token): This returns a predefined number of words to the left and right of your token (let's call this collection of words "Z"). It does that for each instance that your token appears in the text.

    2) similar(token): A word will be listed here if its occurrence within the words of the set "Z" is rather likely.

提交回复
热议问题