https://github.com/thinkful-ed/solution-code-text-processing-api-project
https://github.com/thinkful-ed/solution-code-text-processing-api-project
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thinkful-ed/solution-code-text-processing-api-project
- Owner: Thinkful-Ed
- Created: 2023-10-25T23:41:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T19:03:16.000Z (over 2 years ago)
- Last Synced: 2023-11-20T17:51:13.456Z (over 2 years ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solution Code: Text Processing API Project
This API provides text processing functionalities, such as tokenization into words and sentences, and spelling correction, leveraging the capabilities of the TextBlob library.
## Installation
1. Clone this repository.
2. Navigate to the project directory:
```bash
cd path_to_directory
```
3. Set up a virtual environment (recommended). Depending on your operating system, use one of the following:
- On macOS and Linux:
```bash
python -m venv venv
source venv/bin/activate
```
- On Windows:
```bash
python -m venv venv
.\venv\Scripts\activate
```
4. Install the required packages (Flask should be in the `requirements.txt`):
```shell
pip install -r requirements.txt
```
5. And then, download the necessary corpora for TextBlob:
```bash
python -m textblob.download_corpora
```
6. Run the API:
* By default, the API will start on `http://127.0.0.1:5001/`.
```bash
python path_to_file.py
```
## Endpoints and Usage
1. Home Endpoint:
Navigate to `/` to get a welcome message.
2. Tokenization Endpoint (`/tokenize`):
- Method: `POST`
- Request Body: `{"text": "Your text here."}`
- Response: A JSON with tokenized words and sentences.
3. Text Correction Endpoint (`/correct`):
- Method: `POST`
- Request Body: `{"text": "Your text with errrs."}`
- Response: A JSON with the corrected text.
## Description
This API is built on Flask and utilizes the TextBlob library for natural language processing tasks, such as tokenization and spelling correction. The API is designed to be simple, intuitive, and cater to basic text processing needs.