Algorithm to find related words in a text

前端 未结 5 512
后悔当初
后悔当初 2021-02-03 13:35

I would like to have a word (e.g. \"Apple) and process a text (or maybe more). I\'d like to come up with related terms. For example: process a document for Apple and find that i

5条回答
  •  野的像风
    2021-02-03 14:06

    Like all of AI, it's a very difficult problem. You should look into natural language processing to learn about some of the issues.

    One very, very simplistic approach can be to build a 2d-table of words, with for each pair of words the average distance (in words) that they appear in the text. Obviously you'll need to limit the maximum distance considered, and possibly the number of words as well. Then, after processing a lot of text you'll have an indicator of how often certain words appear in the same context.

提交回复
热议问题