updated README.md

master
B.J. Dweck 2023-09-08 16:29:15 +03:00
parent c3ca249877
commit 61827b4e11
1 changed files with 24 additions and 0 deletions

View File

@ -4,6 +4,7 @@ A comprehensive toolkit that offers:
- Conversion of CSV files into Anki deck packages (.apkg files).
- Conversion of image files in a directory to a text file using Optical Character Recognition (OCR).
- Generation of CSV format question-answer pairs from textual content using OpenAI's GPT-3 model.
- **RESTful API endpoint to upload and convert multiple images directly into an Anki deck package.**
## Features
@ -12,6 +13,7 @@ A comprehensive toolkit that offers:
- Generates CSV formatted question-answer pairs based on a given text content, ideal for studying or summarization.
- For CSV: there are only two columns in the CSV file, separated by the first comma encountered.
- CSV files should have a "Front" column for questions and a "Back" column for answers.
- **API endpoint that accepts multiple image uploads, processes them through the pipeline, and returns an Anki deck package.**
## Installation
@ -31,6 +33,7 @@ A comprehensive toolkit that offers:
```bash
pip install -r requirements.txt
```
## Configuration
Before using the `text2csvdeck.py` script, ensure that you have set the `OPENAI_API_KEY` environment variable:
@ -43,6 +46,27 @@ Remember to replace `your_openai_api_key_here` with your actual OpenAI API key.
## Usage
### **REST API Usage**
To start the server:
```bash
python server.py
```
#### Endpoint: `/generate-deck`
**Method**: POST
**Description**: Accepts multiple image uploads, processes them through the pipeline, and returns an Anki deck package.
**Body**:
- form-data with key `image` and multiple image files as values.
**Response**:
- An `output.apkg` file ready for import into Anki.
### Pipeline Usage
To convert a directory of images directly to an Anki deck package: