Веб-версияОткрыть в Telegram

ПостConvert any long article or PDF into a test in a couple of seconds!

18 декабря 2025
P
Python Projects & Free Books
Convert any long article or PDF into a test in a couple of seconds! Mini-service: we take the text of the article (or extract it from PDF), send it to GPT and receive a set of test questions with answer options and a key. First, we load the text of the material: # article_text — this is where we put the text of the article with open("article.txt", "r", encoding="utf-8") as f:     article_text = f.read() # for PDF, you can extract the text in advance with any library (PyPDF2, pdfplumber, etc.) Next, we ask GPT to generate a test: prompt = (     "You are an exam methodologist."     "Based on this text, create 15 test questions."     "Each question is in the format:\n"     "1) Question text\n"     "A. Option 1\n"     "B. Option 2\n"     "C. Option 3\n"     "D. Option 4\n"     "Correct answer: <letter>."     "Do not add explanations and comments, only questions, options, and correct answers." ) response = client.chat.completions.create(     model="gpt-4o",     messages=[         {"role": "system", "content": prompt},         {"role": "user", "content": article_text}     ]) print(response.choices[0].message.content.strip()) ✅ Suitable for online courses, educational centers, and corporate training — you immediately get a ready-made bank of tests from any article.
12 · 3.2K ·

Рядом в ленте

PPython Projects & Free Books🔰 For Loop In PythonPPython Projects & Free Books- Location of Mobile Number Code - import phonenumbers from phonenumbers import timezone from phonenumbers import geocoder from phonenumbers import carrier numb
это сообщение
PPython Projects & Free Books✅ 📚 Python Libraries You Should Know 1. NumPy – Numerical computing - Arrays, matrices, broadcasting - Fast operations on large datasets - Useful in data sciencPPython Projects & Free BooksPython Roadmap 🐍 (Beginner → Job) 📂 Syntax Basics ∟ Variables, Data Types ∟ Conditions & Loops 📂 Data Structures ∟ List, Tuple, Set, Dict ∟ Comprehensions 📂 Alg
PPython Projects & Free BooksPython Projects & Free Books@pythonfreebootcamp · канал · Технологии
40 695подписчиков1 176средний охват поста
Лента площадки Открыть в Telegram

Открытая публичная лента из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Чего мы не делаем · Убрать страницу из выдачи · Каталог · Поиск · Как мы считаем