Spaces:
Runtime error
Runtime error
Commit
·
d72be0f
1
Parent(s):
e773143
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
def process_article_content(content):
|
| 4 |
+
words = len(content.split())
|
| 5 |
+
characters = len(content)
|
| 6 |
+
return words, characters
|
| 7 |
+
|
| 8 |
+
# Streamlit app
|
| 9 |
+
def main():
|
| 10 |
+
st.title("Article Content Processor")
|
| 11 |
+
|
| 12 |
+
# Input field for article content
|
| 13 |
+
article_content = st.text_area("Enter Article Content:", "")
|
| 14 |
+
|
| 15 |
+
# Process button
|
| 16 |
+
if st.button("Process"):
|
| 17 |
+
# Process the article content
|
| 18 |
+
if article_content:
|
| 19 |
+
word_count, char_count = process_article_content(article_content)
|
| 20 |
+
|
| 21 |
+
# Display the output
|
| 22 |
+
st.subheader("Processed Output:")
|
| 23 |
+
st.write(f"Word Count: {word_count}")
|
| 24 |
+
st.write(f"Character Count: {char_count}")
|
| 25 |
+
|
| 26 |
+
if __name__ == "__main__":
|
| 27 |
+
main()
|