AdithyaSNair commited on
Commit
88ddc48
·
verified ·
1 Parent(s): 0c0b5ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +71 -34
app.py CHANGED
@@ -595,50 +595,86 @@ def cover_letter_generator_page():
595
  st.error("Failed to generate cover letter.")
596
 
597
  def resume_analysis_page():
598
- st.header("Resume Analysis and Optimization")
599
 
600
- uploaded_file = st.file_uploader("Upload your resume (PDF format):", type="pdf")
 
 
 
 
601
 
602
  if uploaded_file:
603
  resume_text = extract_text_from_pdf(uploaded_file)
604
  if resume_text:
605
- st.success("Resume uploaded successfully!")
606
- # Perform analysis
607
- st.subheader("Extracted Information")
608
- # Extracted skills
609
- skills = extract_skills(resume_text)
610
- st.write("**Skills:**", ', '.join(skills) if skills else "No skills extracted.")
611
- # Extract keywords
612
- keywords = suggest_keywords(resume_text)
613
- st.write("**Suggested Keywords for ATS Optimization:**", ', '.join(keywords) if keywords else "No keywords suggested.")
614
- # Provide optimization suggestions
615
- st.subheader("Optimization Suggestions")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  if keywords:
617
- st.write("- **Keyword Optimization:** Incorporate the suggested keywords to improve ATS compatibility.")
 
 
 
618
  else:
619
- st.write("- **Keyword Optimization:** No keywords suggested.")
620
- st.write("- **Formatting:** Ensure consistent formatting for headings and bullet points to enhance readability.")
621
- st.write("- **Experience Details:** Provide specific achievements and quantify your accomplishments where possible.")
 
 
 
622
 
623
  # Visual Resume Analytics
624
- st.subheader("Visual Resume Analytics")
625
- # Skill Distribution Chart
626
- if skills:
627
- st.write("**Skill Distribution:**")
628
- fig_skills = create_skill_distribution_chart(skills)
629
- st.plotly_chart(fig_skills)
630
- else:
631
- st.write("**Skill Distribution:** No skills to display.")
632
 
633
- # Experience Timeline (if applicable)
634
- fig_experience = create_experience_timeline(resume_text)
635
- if fig_experience:
636
- st.write("**Experience Timeline:**")
637
- st.plotly_chart(fig_experience)
638
- else:
639
- st.write("**Experience Timeline:** Not enough data to generate a timeline.")
 
 
 
 
 
 
 
 
 
 
 
640
 
641
  # Save the resume and analysis to the database
 
642
  if st.button("Save Resume Analysis"):
643
  add_application(
644
  job_title="N/A",
@@ -651,9 +687,10 @@ def resume_analysis_page():
651
  resume_text=resume_text,
652
  skills=skills
653
  )
654
- st.success("Resume analysis saved successfully!")
655
  else:
656
- st.error("Failed to extract text from resume.")
 
657
 
658
  def application_tracking_dashboard():
659
  st.header("Application Tracking Dashboard")
 
595
  st.error("Failed to generate cover letter.")
596
 
597
  def resume_analysis_page():
598
+ st.header("📄 Resume Analysis and Optimization")
599
 
600
+ st.write("""
601
+ Enhance your resume's effectiveness with our comprehensive analysis tools. Upload your resume to extract key information, receive optimization suggestions, and visualize your skills and experience.
602
+ """)
603
+
604
+ uploaded_file = st.file_uploader("📂 Upload your resume (PDF format):", type="pdf")
605
 
606
  if uploaded_file:
607
  resume_text = extract_text_from_pdf(uploaded_file)
608
  if resume_text:
609
+ st.success("Resume uploaded successfully!")
610
+
611
+ # Extracted Information
612
+ st.subheader("🔍 Extracted Information")
613
+
614
+ # Create tabs for organized sections
615
+ tabs = st.tabs(["💼 Skills", "🔑 Suggested Keywords"])
616
+
617
+ with tabs[0]:
618
+ skills = extract_skills(resume_text)
619
+ if skills:
620
+ st.markdown("**Identified Skills:**")
621
+ # Display skills as tags or bullet points
622
+ cols = st.columns(4)
623
+ for idx, skill in enumerate(skills, 1):
624
+ cols[idx % 4].write(f"- {skill}")
625
+ else:
626
+ st.info("No skills extracted.")
627
+
628
+ with tabs[1]:
629
+ keywords = suggest_keywords(resume_text)
630
+ if keywords:
631
+ st.markdown("**Suggested Keywords for ATS Optimization:**")
632
+ # Display keywords as tags
633
+ cols = st.columns(4)
634
+ for idx, keyword in enumerate(keywords, 1):
635
+ cols[idx % 4].write(f"- {keyword}")
636
+ else:
637
+ st.info("No keywords suggested.")
638
+
639
+ # Optimization Suggestions
640
+ st.subheader("🛠️ Optimization Suggestions")
641
  if keywords:
642
+ st.markdown("""
643
+ - **Keyword Optimization:** Incorporate the suggested keywords to improve ATS compatibility.
644
+ - **Enhance Relevant Sections:** Highlight skills and experiences that align closely with job descriptions.
645
+ """)
646
  else:
647
+ st.markdown("- **Keyword Optimization:** No keywords suggested.")
648
+ st.markdown("""
649
+ - **Formatting:** Ensure consistent formatting for headings, bullet points, and text alignment to enhance readability.
650
+ - **Quantify Achievements:** Where possible, quantify your accomplishments to demonstrate impact.
651
+ - **Tailor Your Resume:** Customize your resume for each job application to emphasize relevant experiences.
652
+ """)
653
 
654
  # Visual Resume Analytics
655
+ st.subheader("📊 Visual Resume Analytics")
 
 
 
 
 
 
 
656
 
657
+ # Create two columns for charts
658
+ viz_col1, viz_col2 = st.columns(2)
659
+
660
+ with viz_col1:
661
+ if skills:
662
+ st.markdown("**Skill Distribution:**")
663
+ fig_skills = create_skill_distribution_chart(skills)
664
+ st.plotly_chart(fig_skills, use_container_width=True)
665
+ else:
666
+ st.info("No skills to display.")
667
+
668
+ with viz_col2:
669
+ fig_experience = create_experience_timeline(resume_text)
670
+ if fig_experience:
671
+ st.markdown("**Experience Timeline:**")
672
+ st.plotly_chart(fig_experience, use_container_width=True)
673
+ else:
674
+ st.info("Not enough data to generate an experience timeline.")
675
 
676
  # Save the resume and analysis to the database
677
+ st.subheader("💾 Save Resume Analysis")
678
  if st.button("Save Resume Analysis"):
679
  add_application(
680
  job_title="N/A",
 
687
  resume_text=resume_text,
688
  skills=skills
689
  )
690
+ st.success("Resume analysis saved successfully!")
691
  else:
692
+ st.error("Failed to extract text from resume.")
693
+
694
 
695
  def application_tracking_dashboard():
696
  st.header("Application Tracking Dashboard")