Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to find mutual words in title field?

조회 수: 1 (최근 30일)
bita hallajian
bita hallajian 2018년 7월 6일
마감: MATLAB Answer Bot 2021년 8월 20일
The aim is to write a program that surveys an excel file on "title" field and distinguish the items which have mutual words in "title" field. (the excel file is attached). The question is can I use text analytics toolbox for this program if it is possible, How should I write its program? With great thanks
  댓글 수: 2
Paolo
Paolo 2018년 7월 6일
Is it a requirement to use the text analytics toolbox? I am sure the problem can be solved easily without it too. What is the expected output?
bita hallajian
bita hallajian 2018년 7월 6일
My output is to make a graph to show the relation for the title fields which have mutual words in each line. For John & Rob, if the word "image" exists in their both title fields, there will be connection between them. The more repitition of connection cause increase the edge's weight. May I have your idea how to do? Thanks greatly

답변 (2개)

Sarah Palfreyman
Sarah Palfreyman 2018년 7월 6일
Yes, Text Analytics can help with this. It sounds like you are performing Topic Modeling, or grouping the data into sets of similar words.
https://www.mathworks.com/help/textanalytics/examples/analyze-text-data-using-topic-models.html

Christopher Creutzig
Christopher Creutzig 2018년 11월 26일
If I read the question correctly, you are looking for a co-occurence matrix. You can get those from a bag-of-Words model by a matrix multiplication:
txt = ["my first title", "your first idea", "my second or minute"];
td = tokenizedDocument(txt);
bow = bagOfWords(td);
cnt = bow.Counts;
full(cnt*cnt.')
ans = 3×3
3 1 1
1 3 0
1 0 4
The first row says the first sentence has three words in common with itself (duh), and one each with the second and third sentence. The second and third string do not have words in common, hence the zeroes.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by