Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
ml_questions = [
|
| 4 |
+
"Explain the bias–variance tradeoff.",
|
| 5 |
+
"What is regularization and why is it useful?",
|
| 6 |
+
"How does gradient descent work?",
|
| 7 |
+
"What is the difference between batch, mini‑batch, and stochastic gradient descent?",
|
| 8 |
+
"Explain precision, recall, F1 score, and when you would use each.",
|
| 9 |
+
"What is overfitting and how do you prevent it?",
|
| 10 |
+
"Describe how a decision tree works.",
|
| 11 |
+
"What is the difference between bagging and boosting?",
|
| 12 |
+
"Explain how a convolutional neural network processes images.",
|
| 13 |
+
"What is the purpose of a learning rate scheduler?",
|
| 14 |
+
"How does dropout work and why is it effective?",
|
| 15 |
+
"What is the difference between L1 and L2 regularization?",
|
| 16 |
+
"Explain the concept of embeddings.",
|
| 17 |
+
"What is transfer learning and when is it useful?",
|
| 18 |
+
"How do you evaluate a clustering algorithm?",
|
| 19 |
+
"What is the difference between generative and discriminative models?",
|
| 20 |
+
"Explain the attention mechanism in transformers.",
|
| 21 |
+
"What is gradient vanishing/exploding and how do you address it?",
|
| 22 |
+
"Describe the steps in a typical ML pipeline.",
|
| 23 |
+
"What is the difference between supervised, unsupervised, and reinforcement learning?"
|
| 24 |
+
]
|
| 25 |
+
|
| 26 |
+
def get_questions(n):
|
| 27 |
+
n = int(n)
|
| 28 |
+
return "\n\n".join(ml_questions[:n])
|
| 29 |
+
|
| 30 |
+
with gr.Blocks() as demo:
|
| 31 |
+
gr.Markdown("# 🧠 ML Interview Question Generator\nSelect how many questions you want to display.")
|
| 32 |
+
|
| 33 |
+
num = gr.Slider(1, len(ml_questions), value=5, step=1, label="Number of Questions")
|
| 34 |
+
output = gr.Textbox(label="Interview Questions", lines=20)
|
| 35 |
+
|
| 36 |
+
num.change(fn=get_questions, inputs=num, outputs=output)
|
| 37 |
+
|
| 38 |
+
demo.launch()
|