File size: 11,050 Bytes
3c34a24
9098515
3c34a24
 
 
 
 
 
 
 
 
9098515
3c34a24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417ad57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
---
title: PDF with Flashcard Generation | AI-Powered Study Companion
emoji: πŸ“š
colorFrom: blue
colorTo: green
sdk: docker
sdk_version: "3.9"
app_file: app.py
pinned: false
---

# PDF with Flashcard Generation: AI-Powered Study Companion

Elevate your learning experience with our AI-driven document viewer and flashcard generator! This web application transforms your PDFs, TXT files, and EPUBs into interactive flashcards and explanations using Claude AI, perfect for importing into Anki. Ideal for students, researchers, and lifelong learners looking to enhance their study sessions and spaced repetition practice.

![Application Screenshot](https://your-screenshot-url-here.com)

## Key Features:
- πŸ“š Upload and view PDFs, TXT files, and EPUBs directly in your browser
- πŸ€– Generate flashcards and explanations with Claude AI
- 🌐 Language learning mode for vocabulary acquisition
- πŸ–οΈ Highlight important text for focused learning
- πŸ’Ύ Save and export your flashcard collections to Anki-compatible format
- πŸ“± Responsive design for desktop and mobile use
- πŸ”„ Seamless integration with Anki for optimized spaced repetition

Dive into your documents, emerge with knowledge at your fingertips, and supercharge your Anki decks!

## Getting Started

### Prerequisites
- Docker
- Anthropic API key

### Installation

1. Clone the repository:
   ```
   git clone https://github.com/your-username/document-viewer-flashcard-generator.git
   cd document-viewer-flashcard-generator
   ```

2. Build the Docker image:
   ```
   docker build -t document-viewer-flashcard-generator .
   ```

3. Run the Docker container:
   ```
   docker run -p 7860:7860 document-viewer-flashcard-generator
   ```

4. Open your web browser and navigate to `http://localhost:7860`

## Usage

1. Upload a PDF, TXT, or EPUB file using the file input at the top of the page
2. Navigate through the document using the page controls or by scrolling
3. Select text in the document viewer
4. Choose a mode (Flashcard, Explain, or Language) and click "Generate" to create content from the selected text
5. For language mode, double-click a word to generate a flashcard
6. View, remove, or export generated flashcards
7. Use the highlight mode (Alt+Select) to mark important text in the document

## API Key Setup

This application requires a Claude API key to function:

1. Sign up for an API key at [https://www.anthropic.com](https://www.anthropic.com)
2. In the application, click the gear icon to open the settings panel
3. Enter your API key in the provided input field

## Deployment on HuggingFace Spaces

This application is designed to be easily deployed on HuggingFace Spaces:

1. Fork this repository to your GitHub account
2. Create a new Space on HuggingFace and choose "Docker" as the SDK
3. Connect your GitHub repository to the HuggingFace Space
4. HuggingFace will automatically build and deploy your Docker container

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For discussing improvements or new features, we encourage you to open an Issue first to facilitate community discussion.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- [PDF.js](https://mozilla.github.io/pdf.js/) for PDF rendering
- [ePub.js](https://github.com/futurepress/epub.js/) for EPUB rendering
- [Anthropic](https://www.anthropic.com) for the Claude AI API
- [Flask](https://flask.palletsprojects.com/) for the web framework
- [Docker](https://www.docker.com/) for containerization

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference for more information on HuggingFace Spaces configuration.[# PDF Flashcard Generator: AI Study CompanionUnlock the power of your PDFs with AI-driven learning! This web application transforms your documents into interactive flashcards and explanations using Claude AI, perfect for importing into **ANKI**. Ideal for students, researchers, and lifelong learners looking to supercharge their study sessions and spaced repetition practice.![image](https://github.com/user-attachments/assets/c82dc51e-588e-4d14-b399-34c6784d5d99)## Key Features:- πŸ“š Upload and view PDFs directly in your browser- πŸ€– Generate flashcards and explanations with Claude AI- πŸ–οΈ Highlight important text for focused learning- πŸ’Ύ Save and export your flashcard collections to **ANKI**-compatible format- πŸ“± Responsive design for desktop and mobile use- πŸ”„ Seamless integration with **ANKI** for optimized spaced repetitionDive into your documents, emerge with knowledge at your fingertips, and supercharge your **ANKI** decks!## Getting Started### Prerequisites- Python 3.7+- Flask- Anthropic API key### Installation1. Clone the repository:   ```   git clone https://github.com/quocdat-le-insacvl/pdf-flashcards-autogen.git   cd pdf-flashcards-autogen   ```2. Install the required packages:   ```   pip install -r requirements.txt   ```3. Set up your Anthropic API key:   - Sign up for an API key at [https://www.anthropic.com](https://www.anthropic.com)   - Add your API key to the application when prompted### Running the Application1. Start the Flask server:   ```   python app.py   ```2. Open your web browser and navigate to `http://localhost:5000`## Usage1. Upload a PDF file using the file input at the top of the page2. Navigate through the PDF using the page controls or by scrolling3. Select text in the PDF viewer4. Click "Generate Flashcard" to create flashcards from the selected text5. View, remove, or export generated flashcards6. Use the highlight mode to mark important text in the PDF## ContributingContributions are welcome! Please feel free to submit a Pull Request. For discussing improvements or new features, we encourage you to open an Issue first to facilitate community discussion.## LicenseThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.## Acknowledgments- [PDF.js](https://mozilla.github.io/pdf.js/) for PDF rendering- [Anthropic](https://www.anthropic.com) for the Claude AI API](# PDF Flashcard Generator: AI Study CompanionUnlock the power of your PDFs with AI-driven learning! This web application transforms your documents into interactive flashcards and explanations using Claude AI, perfect for importing into **ANKI**. Ideal for students, researchers, and lifelong learners looking to supercharge their study sessions and spaced repetition practice.![image](https://github.com/user-attachments/assets/c82dc51e-588e-4d14-b399-34c6784d5d99)## Key Features:- πŸ“š Upload and view PDFs directly in your browser- πŸ€– Generate flashcards and explanations with Claude AI- πŸ–οΈ Highlight important text for focused learning- πŸ’Ύ Save and export your flashcard collections to **ANKI**-compatible format- πŸ“± Responsive design for desktop and mobile use- πŸ”„ Seamless integration with **ANKI** for optimized spaced repetitionDive into your documents, emerge with knowledge at your fingertips, and supercharge your **ANKI** decks!## Getting Started### Prerequisites- Python 3.7+- Flask- Anthropic API key### Installation1. Clone the repository:   ```   git clone https://github.com/quocdat-le-insacvl/pdf-flashcards-autogen.git   cd pdf-flashcards-autogen   ```2. Install the required packages:   ```   pip install -r requirements.txt   ```3. Set up your Anthropic API key:   - Sign up for an API key at [https://www.anthropic.com](https://www.anthropic.com)   - Add your API key to the application when prompted### Running the Application1. Start the Flask server:   ```   python app.py   ```2. Open your web browser and navigate to `http://localhost:5000`## Usage1. Upload a PDF file using the file input at the top of the page2. Navigate through the PDF using the page controls or by scrolling3. Select text in the PDF viewer4. Click "Generate Flashcard" to create flashcards from the selected text5. View, remove, or export generated flashcards6. Use the highlight mode to mark important text in the PDF## ContributingContributions are welcome! Please feel free to submit a Pull Request. For discussing improvements or new features, we encourage you to open an Issue first to facilitate community discussion.## LicenseThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.## Acknowledgments- [PDF.js](https://mozilla.github.io/pdf.js/) for PDF rendering- [Anthropic](https://www.anthropic.com) for the Claude AI API)

Unlock the power of your PDFs with AI-driven learning! This web application transforms your documents into interactive flashcards and explanations using Claude AI, perfect for importing into **ANKI**. Ideal for students, researchers, and lifelong learners looking to supercharge their study sessions and spaced repetition practice.

![image](https://github.com/user-attachments/assets/c82dc51e-588e-4d14-b399-34c6784d5d99)

## Key Features:
- πŸ“š Upload and view PDFs directly in your browser
- πŸ€– Generate flashcards and explanations with Claude AI
- πŸ–οΈ Highlight important text for focused learning
- πŸ’Ύ Save and export your flashcard collections to **ANKI**-compatible format
- πŸ“± Responsive design for desktop and mobile use
- πŸ”„ Seamless integration with **ANKI** for optimized spaced repetition

Dive into your documents, emerge with knowledge at your fingertips, and supercharge your **ANKI** decks!

## Getting Started

### Prerequisites

- Python 3.7+
- Flask
- Anthropic API key

### Installation

1. Clone the repository:
   ```
   git clone https://github.com/quocdat-le-insacvl/pdf-flashcards-autogen.git
   cd pdf-flashcards-autogen
   ```

2. Install the required packages:
   ```
   pip install -r requirements.txt
   ```

3. Set up your Anthropic API key:
   - Sign up for an API key at [https://www.anthropic.com](https://www.anthropic.com)
   - Add your API key to the application when prompted

### Running the Application

1. Start the Flask server:
   ```
   python app.py
   ```

2. Open your web browser and navigate to `http://localhost:5000`

## Usage

1. Upload a PDF file using the file input at the top of the page
2. Navigate through the PDF using the page controls or by scrolling
3. Select text in the PDF viewer
4. Click "Generate Flashcard" to create flashcards from the selected text
5. View, remove, or export generated flashcards
6. Use the highlight mode to mark important text in the PDF

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For discussing improvements or new features, we encourage you to open an Issue first to facilitate community discussion.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- [PDF.js](https://mozilla.github.io/pdf.js/) for PDF rendering
- [Anthropic](https://www.anthropic.com) for the Claude AI API