xjlulu commited on
Commit
69549c8
1 Parent(s): d715d6c
Files changed (3) hide show
  1. README.md +27 -42
  2. app.py +1 -1
  3. requirements.txt +1 -0
README.md CHANGED
@@ -10,65 +10,50 @@ pinned: false
10
  license: apache-2.0
11
  ---
12
 
13
- # Text Summarization with Hugging Face Transformers and Gradio
14
 
15
- This project demonstrates text summarization using Hugging Face Transformers and Gradio. It provides an easy-to-use interface for summarizing text.
16
 
17
- ## Demo
18
 
19
- You can try out the Text Summarization application [here](https://huggingface.co/spaces/xjlulu/summarization). Simply enter a piece of text, and the application will generate a summary for you.
20
 
21
- ## Getting Started
22
 
23
- ### Prerequisites
 
 
24
 
25
- Before running the application, make sure you have Python and the required packages installed:
26
 
27
- - Python 3.6+
28
- - Hugging Face Transformers
29
- - Gradio
30
 
31
- You can install the necessary Python packages using `pip`:
32
 
33
- ```shell
34
- pip install transformers gradio
35
- ```
36
 
37
- ### Installation
38
 
39
- 1. Clone this repository:
40
- ```shell
41
- # Make sure you have git-lfs installed (https://git-lfs.com)
42
- git lfs install
43
- git clone https://huggingface.co/spaces/xjlulu/summarization
44
 
45
- # if you want to clone without large files just their pointers
46
- # prepend your git clone with the following env var:
47
- GIT_LFS_SKIP_SMUDGE=1
48
- ```
49
 
50
- 2. Change to the project directory:
51
- ```shell
52
- cd summarization
53
- ```
54
- 3. Run the application:
55
- ```shell
56
- python app.py
57
- ```
58
 
59
- Your Gradio application should now be running, and you can access it at [http://localhost:7860](http://localhost:7860).
60
 
61
- ### Usage
62
 
63
- 1. Enter a piece of text in the provided input field.
64
- 2. Click the "Summarize" button.
65
- 3. The application will generate a summary of the input text and display it.
66
 
67
- ### Contributing
68
 
69
- We welcome contributions from the community. If you find any issues or have ideas for improvements, please open an issue or submit a pull request.
70
 
71
- ### License
72
-
73
- This project is licensed under the [Apache License 2.0](LICENSE). See the [LICENSE](LICENSE) file for details.
74
 
 
 
10
  license: apache-2.0
11
  ---
12
 
13
+ # Text Summarization Hugging Face Spaces App
14
 
15
+ Welcome to the Text Summarization Hugging Face Spaces App! This app allows you to generate text titles using the XJLULU/NTU_ADL_SUMMARIZATION_MT5_S model.
16
 
17
+ ## App Description
18
 
19
+ This app takes a piece of text as input and generates a summary of the text. You can either enter your own text or click the "Random" button to get a random example from a provided dataset and generate a summary.
20
 
21
+ ## How to Use
22
 
23
+ 1. Enter or paste a piece of text into the "Context paragraph" textbox.
24
+ 2. Click the "Generate" button to generate a summary.
25
+ 3. You can also click the "Random" button to generate a random example for summarization.
26
 
27
+ ## Example Data
28
 
29
+ The app uses a dataset of examples provided in the `sample_data.jsonl` file. Each example in the dataset contains a "text" field. You can either provide your own text or use the "Random" button to choose an example from the dataset.
 
 
30
 
31
+ ## Model Information
32
 
33
+ This project uses the `xjlulu/ntu_adl_summarization_mt5_s` model from Hugging Face.
 
 
34
 
 
35
 
36
+ ## Local Setup
 
 
 
 
37
 
38
+ If you want to run this app locally, follow these steps:
 
 
 
39
 
40
+ 1. Clone the repository: `git clone https://huggingface.co/spaces/xjlulu/summarization`
41
+ 2. Navigate to the project directory: `cd summarization`
42
+ 3. Install the required libraries: `pip install -r requirements.txt`
43
+ 4. Run the app: `python app.py`
 
 
 
 
44
 
45
+ The app will start locally and be accessible at `http://localhost:7860`. You can access it in your web browser.
46
 
47
+ ## Credits
48
 
49
+ - [Hugging Face Transformers](https://github.com/huggingface/transformers)
50
+ - [Gradio](https://gradio.app/)
51
+ - [apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
52
 
53
+ ## License
54
 
55
+ This project is licensed under the apache-2.0 - see the [apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) file for details.
56
 
57
+ ## Acknowledgments
 
 
58
 
59
+ Thank you to the open-source community for developing the amazing tools and libraries that make this project possible.
app.py CHANGED
@@ -26,7 +26,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Text Summarization") as demo:
26
  gr.Markdown(description)
27
 
28
  C_input = gr.Textbox(lines=12, label="Context paragraph")
29
- S_output = Textbox(lines=3, label="summary")
30
  with gr.Row():
31
  random_button = gr.Button("Random")
32
  generate_button = gr.Button("Generate")
 
26
  gr.Markdown(description)
27
 
28
  C_input = gr.Textbox(lines=12, label="Context paragraph")
29
+ S_output = Textbox(lines=3, label="title")
30
  with gr.Row():
31
  random_button = gr.Button("Random")
32
  generate_button = gr.Button("Generate")
requirements.txt CHANGED
@@ -1,5 +1,6 @@
1
  text-generation==0.6.0
2
  transformers==4.31.0
 
3
  pymongo==4.4.1
4
  torch
5
  sentencepiece
 
1
  text-generation==0.6.0
2
  transformers==4.31.0
3
+ gradio
4
  pymongo==4.4.1
5
  torch
6
  sentencepiece