Machine Learning with Python
68.3K subscribers
1.29K photos
95 videos
169 files
950 links
Learn Machine Learning with hands-on Python tutorials, real-world code examples, and clear explanations for researchers and developers.

Admin: @HusseinSheikho || @Hussein_Sheikho
Download Telegram
Automate the Boring Stuff with Python Workbook 2025

The Best Book to Learn Python is available on our collection on Signal

https://signal.group/#CjQKIPcpEqLQow53AG7RHjeVk-4sc1TFxyym3r0gQQzV-OPpEhCPw_-kRmJ8LlC13l0WiEfp
5
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.

🚪 https://t.iss.one/CodeProgrammer
Please open Telegram to view this post
VIEW IN TELEGRAM
2👍2
Please open Telegram to view this post
VIEW IN TELEGRAM