RtextSummary
0.1.0Summarizes Text by Extracting Relevant Sentences
Overview
Build a text summary by extracting relevant sentences from your text. The training dataset should consist of several documents, each document should have sentences separated by a period. While fitting the model, the 'term frequency - inverse document frequency' (TF-IDF) matrix that reflects how important a word is to a document is calculated first. Then vector representations for words are obtained from the 'global vectors for word representation' algorithm (GloVe). While applying the model on new data, the GloVe word vectors for each word are weighted by their TF-IDF weights and averaged to give a sentence vector or a document vector. The magnitude of this sentence vector gives the importance of that sentence within the document. Another way to obtain the importance of the sentence is to calculate cosine similarity between the sentence vector and the document vector. The output can either be at the sentence level (sentences and weights are returned) or at a document level (the summary for each document is returned). It is useful to first get a sentence level output and get quantiles of the sentence weights to determine a cutoff threshold for the weights. This threshold can then be used in the document level output. This method is a variation of the TF-IDF extractive summarization method mentioned in a review paper by Gupta (2010) doi:10.4304/jetwi.2.3.258-268.
Install
Health
CRAN check results are not tracked yet.
Documentation
- Examples that run
- 100%
- Documented parameters
- not tracked
- Return-value docs
- 0%
- References docs
- 33%
Downloads
Dependencies
Nothing depends on this yet.
Code & Tests
- Cyclomatic complexity
- 1.0 median / 1 max
Test coverage
Line coverage
–
Expression
–
Tests / Examples
–
Functions
1 0 exported
Complexity
1 avg / 1 max
Call network
1 nodes / 0 edges
Test coverage has not been measured for this package yet; nodes fall back to a neutral fill.
Call graph
Open call graph →Lowest coverage
Per-function coverage is not measured for this package yet.
Datasets
| Name | Class | Rows × Cols | Also ships in |
|---|---|---|---|
| opinosis | data.frame | 51 × 7 | – |
| stopwords_longlist | vector | – | – |
People & History
1 release. R releases are shown for context.
- RR 4.0.0 released · 2020-04-24
- archivedRemoved from CRAN2020-01-28depends on archived package 'Matrix.utils'
- 0.1.02019-06-07
- RR 3.6.0 released · 2019-04-26
Package metadata
- Total releases
- 1
- License
- GPL-3 OSI
- Minimum R
- ≥ 2.10
- Bundled data
- 187 KB / 2 files
- Download size
- not tracked yet
- Installed size
- not tracked yet
- With dependencies
- not tracked yet