-
Read the text.
-
Remove useless characters from the text.
-
Splitting text into sentences and words as array.
-
Tokenizing individual words present.
-
Calculating influence factor of each words.
-
Measuring average influence of the sentence using word influence.
-
Ranking sentences based on that influences.
-
Re-sequencing top N influencial sentences sentences with
-
Displaying summarized text and saving it to the output.txt file.
This model barely uses any complicated libraries, rather it uses numpy. Version I used is given in requirements.txt. But it is more likely latest version of numpy works just fine.
pip install numpy
If you are facing any compatibility issues try:
pip install -r requirements.txt
This model can be inferenced by various ways. First step is to clone the repo.
git clone https://github.com/AnjaanKhadka/Extractive-text-summarization-Nepali.git
Then execute following code to get summary from text in sample.txt file
python main.py
This inferencing will give summarized text as:
To use this model on custom text file, execute following code.
python main.py -i <path_to_your_text_file> -o <path_to_your_text_file>
Or you can execute
python main.py -t
Then CLI asks for the text input and you can get summary that way as well.