This is a Python command-line tool for summarizing text using the Qwen2 0.5B model via the Ollama API. The tool can handle both text files and direct text input.
- Python: Ensure you have Python installed. You can download it from python.org.
- Ollama: Download Ollama. You can download it from ollama.com.
-
Download Ollama:
- Visit the Ollama website and download the appropriate version for your operating system.
-
Run the Qwen2 0.5B Model:
- Open a terminal and run the following command to start the Qwen2 0.5B model:
ollama run qwen2:0.5b
- Open a terminal and run the following command to start the Qwen2 0.5B model:
Clone this repository to your local machine:
git clone https://github.com/kshitijv09/py-text-summarizer.git
cd py-text-summarizer
pip install -r requirements.txt
By providing a text file. In this case summary will be saved in a file summary.txt
python summarizer.py -t path/to/textfile.txt
Directly passing text as argument
python summarizer.py "Your direct text here"