Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,11 @@
|
|
1 |
-
# app.py
|
2 |
import streamlit as st
|
3 |
from transformers import pipeline
|
4 |
from langdetect import detect
|
5 |
-
from gingerit.gingerit import GingerIt
|
6 |
|
7 |
# Initialize models
|
8 |
summarizer = pipeline("summarization")
|
9 |
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ur")
|
10 |
-
|
11 |
|
12 |
st.set_page_config(page_title="CSS AI Assistant by Komal", layout="wide")
|
13 |
|
@@ -42,21 +40,4 @@ elif menu == "Precis Evaluation":
|
|
42 |
st.header("✍️ Precis Evaluation Tool")
|
43 |
precis_input = st.text_area("Enter your precis for evaluation:", height=200)
|
44 |
if st.button("Evaluate Precis") and precis_input:
|
45 |
-
|
46 |
-
st.success("✅ Corrected Precis:")
|
47 |
-
st.write(result['result'])
|
48 |
-
|
49 |
-
# --- Essay Feedback ---
|
50 |
-
elif menu == "Essay Feedback":
|
51 |
-
st.header("🖋️ Essay Evaluation Tool")
|
52 |
-
essay_input = st.text_area("Paste your essay here:", height=300)
|
53 |
-
if st.button("Evaluate Essay") and essay_input:
|
54 |
-
result = corrector.parse(essay_input)
|
55 |
-
st.success("✅ Suggestions:")
|
56 |
-
st.write(result['result'])
|
57 |
-
|
58 |
-
# --- Saved Notes (Stub) ---
|
59 |
-
elif menu == "Saved Notes":
|
60 |
-
st.header("💾 Saved Notes")
|
61 |
-
st.info("Note saving functionality coming soon!")
|
62 |
-
st.write("You will be able to store and download your summaries and corrected answers here.")
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
from langdetect import detect
|
|
|
4 |
|
5 |
# Initialize models
|
6 |
summarizer = pipeline("summarization")
|
7 |
translator = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ur")
|
8 |
+
grammar_corrector = pipeline("text2text-generation", model="vennify/t5-base-grammar-correction")
|
9 |
|
10 |
st.set_page_config(page_title="CSS AI Assistant by Komal", layout="wide")
|
11 |
|
|
|
40 |
st.header("✍️ Precis Evaluation Tool")
|
41 |
precis_input = st.text_area("Enter your precis for evaluation:", height=200)
|
42 |
if st.button("Evaluate Precis") and precis_input:
|
43 |
+
corrected = grammar_corrector("grammar: " + precis_input)[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|