Spaces:
Sleeping
Sleeping
Update Interview_preparation.py
Browse files- Interview_preparation.py +101 -101
Interview_preparation.py
CHANGED
@@ -5,105 +5,105 @@ from langchain_community.llms import OpenAI
|
|
5 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
6 |
|
7 |
|
8 |
-
|
9 |
-
roles_and_topics = {
|
10 |
-
|
11 |
-
"Front-End Developer": ["HTML/CSS", "JavaScript and Frameworks (React, Angular, Vue.js)", "Responsive Design", "Browser Compatibility"],
|
12 |
-
"Back-End Developer": ["Server-Side Languages (Node.js, Python, Ruby, PHP)", "Database Management (SQL, NoSQL)", "API Development", "Server and Hosting Management"],
|
13 |
-
"Full-Stack Developer": ["Combination of Front-End and Back-End Topics", "Integration of Systems", "DevOps Basics"],
|
14 |
-
"Mobile Developer": ["Android Development (Java, Kotlin)", "iOS Development (Swift, Objective-C)", "Cross-Platform Development (Flutter, React Native)"],
|
15 |
-
"Data Scientist": ["Statistical Analysis", "Machine Learning Algorithms", "Data Wrangling and Cleaning", "Data Visualization"],
|
16 |
-
"Data Analyst": ["Data Collection and Processing", "SQL and Database Querying", "Data Visualization Tools (Tableau, Power BI)", "Basic Statistics"],
|
17 |
-
"Machine Learning Engineer": ["Supervised and Unsupervised Learning", "Model Deployment", "Deep Learning", "Natural Language Processing"],
|
18 |
-
"DevOps Engineer": ["Continuous Integration/Continuous Deployment (CI/CD)", "Containerization (Docker, Kubernetes)", "Infrastructure as Code (Terraform, Ansible)", "Cloud Platforms (AWS, Azure, Google Cloud)"],
|
19 |
-
"Cloud Engineer": ["Cloud Architecture", "Cloud Services (Compute, Storage, Networking)", "Security in the Cloud", "Cost Management"],
|
20 |
-
"Cybersecurity Analyst": ["Threat Detection and Mitigation", "Security Protocols and Encryption", "Network Security", "Incident Response"],
|
21 |
-
"Penetration Tester": ["Vulnerability Assessment", "Ethical Hacking Techniques", "Security Tools (Metasploit, Burp Suite)", "Report Writing and Documentation"],
|
22 |
-
"Project Manager": ["Project Planning and Scheduling", "Risk Management", "Agile and Scrum Methodologies", "Stakeholder Communication"],
|
23 |
-
"UX/UI Designer": ["User Research", "Wireframing and Prototyping", "Design Principles", "Usability Testing"],
|
24 |
-
"Quality Assurance (QA) Engineer": ["Testing Methodologies", "Automation Testing", "Bug Tracking", "Performance Testing"],
|
25 |
-
"Blockchain Developer": ["Blockchain Fundamentals", "Smart Contracts", "Cryptographic Algorithms", "Decentralized Applications (DApps)"],
|
26 |
-
"Digital Marketing Specialist": ["SEO/SEM", "Social Media Marketing", "Content Marketing", "Analytics and Reporting"],
|
27 |
-
"AI Research Scientist": ["AI Theory", "Algorithm Development", "Neural Networks", "Natural Language Processing"],
|
28 |
-
"AI Engineer": ["AI Model Deployment", "Machine Learning Engineering", "Deep Learning", "AI Tools and Frameworks"],
|
29 |
-
"Generative AI Specialist (GenAI)": ["Generative Models", "GANs (Generative Adversarial Networks)", "Creative AI Applications", "Ethics in AI"],
|
30 |
-
"Generative Business Intelligence Specialist (GenBI)": ["Automated Data Analysis", "Business Intelligence Tools", "Predictive Analytics", "AI in Business Strategy"]
|
31 |
-
|
32 |
-
|
33 |
-
}
|
34 |
-
|
35 |
-
levels = ['Beginner','Intermediate','Advanced']
|
36 |
-
|
37 |
-
Question_Difficulty = ['Easy','Medium','Hard']
|
38 |
-
|
39 |
-
|
40 |
-
st.header("Select AI:")
|
41 |
-
model = st.radio("Model", [ "Gemini","Open AI",])
|
42 |
-
st.write("Selected option:", model)
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
# Header and description
|
47 |
-
st.title("Interview Practice Bot 📚")
|
48 |
-
st.text("Choose the role and topic for your Interview.")
|
49 |
-
|
50 |
-
# User input for quiz generation
|
51 |
-
## Layout in columns
|
52 |
-
col4, col1, col2 = st.columns([1, 1, 1])
|
53 |
-
col5, col3 = st.columns([1, 1])
|
54 |
-
|
55 |
-
|
56 |
-
with col4:
|
57 |
-
|
58 |
-
|
59 |
-
with col1:
|
60 |
-
|
61 |
-
|
62 |
-
with col2:
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
with col5:
|
70 |
-
|
71 |
-
|
72 |
-
with col3:
|
73 |
-
|
74 |
-
|
75 |
-
submit = st.button('Generate Questions')
|
76 |
-
st.write(selected_topic_level, selected_topic, num_quizzes, selected_Question_Difficulty, selected_level, model)
|
77 |
-
|
78 |
-
# Final Response
|
79 |
-
if submit:
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
# Display questions and answers in a table
|
89 |
-
if questions:
|
90 |
-
st.subheader("Quiz Questions and Answers:")
|
91 |
-
# Prepare data for the table
|
92 |
-
col1, col2 = st.columns(2)
|
93 |
-
with col1:
|
94 |
-
st.subheader("Questions")
|
95 |
-
|
96 |
-
st.write(questions)
|
97 |
-
|
98 |
-
with col2:
|
99 |
-
st.subheader("Answers")
|
100 |
-
|
101 |
-
st.write(answers)
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
else:
|
106 |
-
st.warning("No Quiz Questions and Answers")
|
107 |
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
6 |
|
7 |
|
8 |
+
def app():
|
9 |
+
roles_and_topics = {
|
10 |
+
|
11 |
+
"Front-End Developer": ["HTML/CSS", "JavaScript and Frameworks (React, Angular, Vue.js)", "Responsive Design", "Browser Compatibility"],
|
12 |
+
"Back-End Developer": ["Server-Side Languages (Node.js, Python, Ruby, PHP)", "Database Management (SQL, NoSQL)", "API Development", "Server and Hosting Management"],
|
13 |
+
"Full-Stack Developer": ["Combination of Front-End and Back-End Topics", "Integration of Systems", "DevOps Basics"],
|
14 |
+
"Mobile Developer": ["Android Development (Java, Kotlin)", "iOS Development (Swift, Objective-C)", "Cross-Platform Development (Flutter, React Native)"],
|
15 |
+
"Data Scientist": ["Statistical Analysis", "Machine Learning Algorithms", "Data Wrangling and Cleaning", "Data Visualization"],
|
16 |
+
"Data Analyst": ["Data Collection and Processing", "SQL and Database Querying", "Data Visualization Tools (Tableau, Power BI)", "Basic Statistics"],
|
17 |
+
"Machine Learning Engineer": ["Supervised and Unsupervised Learning", "Model Deployment", "Deep Learning", "Natural Language Processing"],
|
18 |
+
"DevOps Engineer": ["Continuous Integration/Continuous Deployment (CI/CD)", "Containerization (Docker, Kubernetes)", "Infrastructure as Code (Terraform, Ansible)", "Cloud Platforms (AWS, Azure, Google Cloud)"],
|
19 |
+
"Cloud Engineer": ["Cloud Architecture", "Cloud Services (Compute, Storage, Networking)", "Security in the Cloud", "Cost Management"],
|
20 |
+
"Cybersecurity Analyst": ["Threat Detection and Mitigation", "Security Protocols and Encryption", "Network Security", "Incident Response"],
|
21 |
+
"Penetration Tester": ["Vulnerability Assessment", "Ethical Hacking Techniques", "Security Tools (Metasploit, Burp Suite)", "Report Writing and Documentation"],
|
22 |
+
"Project Manager": ["Project Planning and Scheduling", "Risk Management", "Agile and Scrum Methodologies", "Stakeholder Communication"],
|
23 |
+
"UX/UI Designer": ["User Research", "Wireframing and Prototyping", "Design Principles", "Usability Testing"],
|
24 |
+
"Quality Assurance (QA) Engineer": ["Testing Methodologies", "Automation Testing", "Bug Tracking", "Performance Testing"],
|
25 |
+
"Blockchain Developer": ["Blockchain Fundamentals", "Smart Contracts", "Cryptographic Algorithms", "Decentralized Applications (DApps)"],
|
26 |
+
"Digital Marketing Specialist": ["SEO/SEM", "Social Media Marketing", "Content Marketing", "Analytics and Reporting"],
|
27 |
+
"AI Research Scientist": ["AI Theory", "Algorithm Development", "Neural Networks", "Natural Language Processing"],
|
28 |
+
"AI Engineer": ["AI Model Deployment", "Machine Learning Engineering", "Deep Learning", "AI Tools and Frameworks"],
|
29 |
+
"Generative AI Specialist (GenAI)": ["Generative Models", "GANs (Generative Adversarial Networks)", "Creative AI Applications", "Ethics in AI"],
|
30 |
+
"Generative Business Intelligence Specialist (GenBI)": ["Automated Data Analysis", "Business Intelligence Tools", "Predictive Analytics", "AI in Business Strategy"]
|
31 |
+
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
levels = ['Beginner','Intermediate','Advanced']
|
36 |
+
|
37 |
+
Question_Difficulty = ['Easy','Medium','Hard']
|
38 |
+
|
39 |
+
|
40 |
+
st.header("Select AI:")
|
41 |
+
model = st.radio("Model", [ "Gemini","Open AI",])
|
42 |
+
st.write("Selected option:", model)
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
# Header and description
|
47 |
+
st.title("Interview Practice Bot 📚")
|
48 |
+
st.text("Choose the role and topic for your Interview.")
|
49 |
+
|
50 |
+
# User input for quiz generation
|
51 |
+
## Layout in columns
|
52 |
+
col4, col1, col2 = st.columns([1, 1, 1])
|
53 |
+
col5, col3 = st.columns([1, 1])
|
54 |
+
|
55 |
+
|
56 |
+
with col4:
|
57 |
+
selected_level = st.selectbox('Select level of understanding', levels)
|
58 |
+
|
59 |
+
with col1:
|
60 |
+
selected_topic_level = st.selectbox('Select Role', list(roles_and_topics.keys()))
|
61 |
+
|
62 |
+
with col2:
|
63 |
+
selected_topic = st.selectbox('Select Topic', roles_and_topics[selected_topic_level])
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
with col5:
|
70 |
+
selected_Question_Difficulty = st.selectbox('Select Question Difficulty', Question_Difficulty)
|
71 |
+
|
72 |
+
with col3:
|
73 |
+
num_quizzes = st.slider('Number of Questions', min_value=1, max_value= 10, value=1)
|
74 |
+
|
75 |
+
submit = st.button('Generate Questions')
|
76 |
+
st.write(selected_topic_level, selected_topic, num_quizzes, selected_Question_Difficulty, selected_level, model)
|
77 |
+
|
78 |
+
# Final Response
|
79 |
+
if submit:
|
80 |
+
questions,answers = GetLLMResponse(selected_topic_level, selected_topic, num_quizzes, selected_Question_Difficulty, selected_level, model)
|
81 |
+
|
82 |
+
with st.spinner("Generating Quizzes..."):
|
83 |
+
questions,answers = GetLLMResponse(selected_topic_level, selected_topic, num_quizzes, selected_Question_Difficulty, selected_level, model)
|
84 |
+
st.success("Quizzes Generated!")
|
85 |
+
|
86 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
+
# Display questions and answers in a table
|
89 |
+
if questions:
|
90 |
+
st.subheader("Quiz Questions and Answers:")
|
91 |
+
# Prepare data for the table
|
92 |
+
col1, col2 = st.columns(2)
|
93 |
+
with col1:
|
94 |
+
st.subheader("Questions")
|
95 |
+
|
96 |
+
st.write(questions)
|
97 |
+
|
98 |
+
with col2:
|
99 |
+
st.subheader("Answers")
|
100 |
+
|
101 |
+
st.write(answers)
|
102 |
+
|
103 |
+
|
104 |
+
|
105 |
+
else:
|
106 |
+
st.warning("No Quiz Questions and Answers")
|
107 |
+
|
108 |
+
else:
|
109 |
+
st.warning("Click the 'Generate Quizzes' button to create quizzes.")
|