From 61827b4e118d63ccdd75de931f93a4c56612dd5d Mon Sep 17 00:00:00 2001 From: Benjamin Dweck Date: Fri, 8 Sep 2023 16:29:15 +0300 Subject: [PATCH] updated README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 66652ae..41f655b 100644 --- a/README.md +++ b/README.md @@ -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: