rank-sentences-keyphrases
Documentation / topics/rank-sentences-keyphrases
rankSentencesCentralToKeyphrase()
function rankSentencesCentralToKeyphrase(sentencesWithKeyphrases: any[], options: object): any[];
Defined in: topics/rank-sentences-keyphrases.js:20
Rank sentences based on their centrality to key phrases. This function implements the TextRank algorithm to weight each sentence based on the number of key phrases it shares with other sentences. It creates a weighted graph where edges connect sentences to matching keyphrases, then performs random walks to distribute probabilities.
- Hongyang Zhao and Qiang Xie 2021 J. Phys.: Conf. Ser. 2078 012021 "An Improved TextRank Multi-feature Fusion Algorithm For Keyword Extraction of Educational Resources" https://iopscience.iop.org/article/10.1088/1742-6596/2078/1/012021/pdf
- Pan, S. et al (2019). "An improved TextRank keywords extraction algorithm" https://dl.acm.org/doi/10.1145/3321408.3326659 https://doi.org/10.1145/3321408.3326659
Parameters
Parameter | Type | Description |
---|---|---|
|
| Array of objects, each containing (text, keyphrases) |
| { } | ‐ |
Returns
any
[]
Updated array with added weights: text, keyphrases, weight