Younesse Kaddar commited on
Commit
e867a2d
β€’
1 Parent(s): 3963768
Files changed (3) hide show
  1. app.py +34 -6
  2. app2.py β†’ app0.py +0 -0
  3. app3.py +0 -87
app.py CHANGED
@@ -30,7 +30,12 @@ import docx
30
  # Load environment variables
31
  load_dotenv(find_dotenv())
32
 
33
- st.set_page_config(page_title="AI Statement Reviewer", page_icon="πŸ“š")
 
 
 
 
 
34
 
35
  # Models for selection
36
  models = ['GPT-3.5', 'GPT-4', 'Claude']
@@ -102,18 +107,41 @@ def get_feedback(text, university, major):
102
  return feedback
103
 
104
  def display_feedback(feedback):
105
- st.write("🌟 Here is the AI feedback:")
106
  # Style the feedback
107
  st.markdown(f'<p style="font-size: 20px">{feedback}</p>', unsafe_allow_html=True)
108
 
109
 
110
  def main():
111
- # Set page title and icon
 
 
 
 
 
 
 
 
 
 
 
 
112
  st.title("πŸŽ“ AI Statement Reviewer πŸ“")
113
 
114
- # Add description
115
  st.header('✨ By Affinity.io ✨')
116
- # your markdown...
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
  # Get file or text input
119
  uploaded_file = st.file_uploader("πŸ“‚ Upload your personal statement here", type=["pdf","docx","txt"], accept_multiple_files=True)
@@ -136,7 +164,7 @@ def main():
136
  feedback = get_feedback(text_input, chosen_university, chosen_major)
137
  display_feedback(feedback)
138
  else:
139
- st.write("Please upload a file or enter your personal statement to get feedback. πŸ“")
140
 
141
  if __name__ == "__main__":
142
  main()
 
30
  # Load environment variables
31
  load_dotenv(find_dotenv())
32
 
33
+ st.set_page_config(
34
+ page_title="AI Statement Reviewer",
35
+ page_icon="πŸ“š",
36
+ layout="centered",
37
+ initial_sidebar_state="expanded",
38
+ )
39
 
40
  # Models for selection
41
  models = ['GPT-3.5', 'GPT-4', 'Claude']
 
107
  return feedback
108
 
109
  def display_feedback(feedback):
110
+ st.write("🌟 πŸ“ Here is your AI feedback:")
111
  # Style the feedback
112
  st.markdown(f'<p style="font-size: 20px">{feedback}</p>', unsafe_allow_html=True)
113
 
114
 
115
  def main():
116
+ """
117
+ AI Statement Reviewer App
118
+
119
+ This application provides an AI-driven statement review service for students applying to universities.
120
+
121
+ The app reviews student personal statements and gives feedback on several aspects:
122
+ 1. Grammar and Structure: The app evaluates the grammar and structural integrity of the personal statement, providing suggestions for improvement where necessary.
123
+ 2. Tips and Recommendations: The app gives personalized tips and recommendations, encouraging students to engage in their own research and further study.
124
+
125
+ The application is designed to democratize access to high-quality personal statement advice, providing feedback that was previously only available to a select few. The ultimate goal is to enhance social mobility and level the playing field for all students, regardless of their background.
126
+
127
+ This application is a part of Afinity.io's suite of student advice services, which aim to provide comprehensive guidance to students choosing courses at the university level. It is also an important step towards Afinity.io's vision for 2030: to have every student make informed study choices through the Afinity platform.
128
+ """
129
  st.title("πŸŽ“ AI Statement Reviewer πŸ“")
130
 
 
131
  st.header('✨ By Affinity.io ✨')
132
+
133
+ st.markdown("""
134
+ This application uses AI to review and provide feedback on your university personal statement!
135
+
136
+ Here's what it does:
137
+
138
+ 1. 🧐 **Review your grammar and structure**: The AI, powered by GPT-4, will check your statement for any grammatical or structural issues.
139
+ 2. πŸ’‘ **Provide tips and recommendations**: Claude, another advanced AI, gives personalized tips and recommendations to make your statement even better.
140
+
141
+ This tool is part of Afinity.io's mission to democratize access to high-quality advice for students, no matter their background.
142
+
143
+ Just upload your personal statement below, and let our AI give you feedback!
144
+ """)
145
 
146
  # Get file or text input
147
  uploaded_file = st.file_uploader("πŸ“‚ Upload your personal statement here", type=["pdf","docx","txt"], accept_multiple_files=True)
 
164
  feedback = get_feedback(text_input, chosen_university, chosen_major)
165
  display_feedback(feedback)
166
  else:
167
+ st.write("πŸ“€ Please upload a file or enter your personal statement to get feedback. πŸ“")
168
 
169
  if __name__ == "__main__":
170
  main()
app2.py β†’ app0.py RENAMED
File without changes
app3.py DELETED
@@ -1,87 +0,0 @@
1
- import os
2
- import pinecone
3
- import streamlit as st
4
- from langchain.document_loaders import TextLoader, PyPDFLoader, Docx2txtLoader
5
- from langchain.text_splitter import RecursiveCharacterTextSplitter
6
- from langchain.embeddings import OpenAIEmbeddings
7
- from langchain.vectorstores import Chroma, Pinecone
8
- from langchain.chains import ConversationalRetrievalChain, LLMChain, SimpleSequentialChain
9
- from langchain.memory import ConversationBufferMemory
10
- from langchain.llms import OpenAI
11
- from langchain.schema import (AIMessage, HumanMessage, SystemMessage)
12
- from langchain.chat_models import ChatOpenAI, ChatAnthropic
13
- from langchain import PromptTemplate
14
- from dotenv import load_dotenv, find_dotenv
15
-
16
-
17
- # Create a function to get the feedback from the AI model
18
- def get_feedback(file, format=".pdf"):
19
- # Get the predictions from the AI model
20
-
21
- # Not implemented yet
22
-
23
- # Create a function to display the feedback
24
- def display_feedback(feedback):
25
- st.header("πŸ“ Here's your feedback:")
26
- st.write(feedback)
27
-
28
- # Create a main function
29
- def main():
30
- """
31
- AI Statement Reviewer App
32
-
33
- This application provides an AI-driven statement review service for students applying to universities.
34
-
35
- The app reviews student personal statements and gives feedback on several aspects:
36
- 1. Grammar and Structure: The app evaluates the grammar and structural integrity of the personal statement, providing suggestions for improvement where necessary.
37
- 2. Tips and Recommendations: The app gives personalized tips and recommendations, encouraging students to engage in their own research and further study.
38
-
39
- The application is designed to democratize access to high-quality personal statement advice, providing feedback that was previously only available to a select few. The ultimate goal is to enhance social mobility and level the playing field for all students, regardless of their background.
40
-
41
- This application is a part of Afinity.io's suite of student advice services, which aim to provide comprehensive guidance to students choosing courses at the university level. It is also an important step towards Afinity.io's vision for 2030: to have every student make informed study choices through the Afinity platform.
42
- """
43
-
44
- load_dotenv(find_dotenv())
45
-
46
- st.set_page_config(
47
- page_title="AI Statement Reviewer",
48
- page_icon="πŸ“š",
49
- layout="centered",
50
- initial_sidebar_state="expanded",
51
- )
52
-
53
- st.title('πŸŽ“ AI Statement Reviewer πŸ“')
54
-
55
- st.header('By Afinity.io')
56
-
57
- st.markdown("""
58
- This application uses AI to review and provide feedback on your university personal statement!
59
-
60
- Here's what it does:
61
-
62
- 1. 🧐 **Review your grammar and structure**: The AI, powered by GPT-4, will check your statement for any grammatical or structural issues.
63
- 2. πŸ’‘ **Provide tips and recommendations**: Claude, another advanced AI, gives personalized tips and recommendations to make your statement even better.
64
-
65
- This tool is part of Afinity.io's mission to democratize access to high-quality advice for students, no matter their background.
66
-
67
- Just upload your personal statement below, and let our AI give you feedback!
68
- """)
69
-
70
- uploaded_file = st.file_uploader("Upload your personal statement here", type=["txt", "docx", "pdf"])
71
- text_input = st.text_area("Or paste your personal statement here:")
72
-
73
- if uploaded_file is not None:
74
- file_type = uploaded_file.type.split('/')[1]
75
- if st.button('Get feedback for uploaded file'):
76
- feedback = get_feedback(uploaded_file, file_type)
77
- display_feedback(feedback)
78
- elif text_input:
79
- if st.button('Get feedback for pasted text'):
80
- feedback = get_feedback(text_input, "string")
81
- display_feedback(feedback)
82
- else:
83
- st.write("πŸ“€ Please upload your personal statement or paste it into the text box.")
84
-
85
-
86
- if __name__ == "__main__":
87
- main()