Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -111,27 +111,15 @@ def main():
|
|
111 |
# Input options
|
112 |
st.markdown("### Enter Requirements")
|
113 |
#input_option = st.radio("Choose input method:", ("Enter Requirements", "Upload PDF"))
|
114 |
-
input_option
|
115 |
|
116 |
requirements = []
|
117 |
-
|
118 |
input_text = st.text_area("Enter your requirements (one per line or separated by periods):")
|
119 |
if input_text:
|
120 |
# Split by periods or newlines
|
121 |
requirements = [req.strip() for req in input_text.replace("\n", ".").split(".") if req.strip()]
|
122 |
-
|
123 |
-
uploaded_file = st.file_uploader("Upload a PDF file:", type="pdf")
|
124 |
-
if uploaded_file:
|
125 |
-
try:
|
126 |
-
with pdfplumber.open(uploaded_file) as pdf:
|
127 |
-
requirements = []
|
128 |
-
for page in pdf.pages:
|
129 |
-
text = page.extract_text()
|
130 |
-
if text:
|
131 |
-
# Split by periods or newlines
|
132 |
-
requirements.extend([req.strip() for req in text.replace("\n", ".").split(".") if req.strip()])
|
133 |
-
except Exception as e:
|
134 |
-
st.error(f"Error reading PDF file: {e}")
|
135 |
|
136 |
# Analyze requirements
|
137 |
if st.button("Analyze Requirements"):
|
|
|
111 |
# Input options
|
112 |
st.markdown("### Enter Requirements")
|
113 |
#input_option = st.radio("Choose input method:", ("Enter Requirements", "Upload PDF"))
|
114 |
+
#input_option = "Enter Requirements"
|
115 |
|
116 |
requirements = []
|
117 |
+
input_option == "Enter Requirements":
|
118 |
input_text = st.text_area("Enter your requirements (one per line or separated by periods):")
|
119 |
if input_text:
|
120 |
# Split by periods or newlines
|
121 |
requirements = [req.strip() for req in input_text.replace("\n", ".").split(".") if req.strip()]
|
122 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
# Analyze requirements
|
125 |
if st.button("Analyze Requirements"):
|