Junior — Middle
Kuidas töötab TextRank algoritm võtmesõnade väljavõtmiseks?
sobes.tech AI
Vastus AI-lt
The TextRank algorithm is a graph-based algorithm inspired by PageRank, used for extracting keywords and key phrases from text.
Working principle:
- The text is split into tokens (words), usually with stop words removed.
- A graph is created where nodes are words and edges are connections between words, for example, if words appear together within a fixed window size.
- Each node is assigned an initial weight.
- The weights of the nodes are iteratively recalculated using a formula similar to PageRank, considering the weights of neighboring nodes.
- After the algorithm converges, words with the highest weights are considered keywords.
Example: if the text frequently contains the words "machine learning" and they are connected with other important words, they will receive a high ranking and be highlighted as keywords.