diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 84918163..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "customizations": { - "codespaces": { - "openFiles": [ - "README.md", - "app.py" - ] - }, - "vscode": { - "settings": {}, - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance" - ] - } - }, - "updateContentCommand": "[ -f packages.txt ] && sudo apt update && sudo apt upgrade -y && sudo xargs apt install -y str: + """Generate a summary for the given input text.""" + summarizer = load_summarizer() + summary = summarizer(text, max_length=150, min_length=30, do_sample=False) + return summary[0]["summary_text"] diff --git a/pages/Text Summarizer.py b/pages/Text Summarizer.py new file mode 100644 index 00000000..58a1a502 --- /dev/null +++ b/pages/Text Summarizer.py @@ -0,0 +1,19 @@ +import streamlit as st +from models.text_sumarization.predict import generate_summary + +st.title("Text Summarization Tool") + +st.write("Enter the text you'd like to summarize (minimum 50 words).") + +user_input = st.text_area("Input Text", height=250) + +# A button to initiate the summarization process +if st.button("Summarize"): + if len(user_input.split()) < 50: + st.warning("Please enter at least 50 words for summarization.") + else: + # Show a spinner while the summarization is being processed + with st.spinner("Summarizing..."): + summary = generate_summary(user_input) # Call the function from predict.py + st.subheader("Summary:") + st.code(summary, language="text", wrap_lines=True) diff --git a/pages/pages.json b/pages/pages.json index 269135e5..b1662cb4 100644 --- a/pages/pages.json +++ b/pages/pages.json @@ -132,6 +132,7 @@ }, "Malware_Detection": { + "title": "PDF Malware Detection", "page_title": "PDF Malware Detection", "page_icon": "\ud83d\udd12", @@ -173,4 +174,5 @@ } ] } + } diff --git a/requirements.txt b/requirements.txt index d43fe9e5..ac7563bf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -63,7 +63,7 @@ matplotlib-inline==0.1.7 mdurl==0.1.2 mistune==3.0.2 narwhals==1.8.1 -numpy==2.1.1 +numpy openpyxl==3.1.5 overrides==7.7.0 packaging==24.1 @@ -78,7 +78,7 @@ pluggy==1.5.0 prometheus_client==0.20.0 prompt_toolkit==3.0.47 prophet==1.1.6 -protobuf==5.28.2 +protobuf==4.25.5 psutil==6.0.0 pure_eval==0.2.3 pyarrow==17.0.0 @@ -138,3 +138,5 @@ webcolors==24.8.0 webencodings==0.5.1 websocket-client==1.8.0 xgboost==2.1.1 +transformers==4.45.2 +tf_keras==2.17.0