renad0 commited on
Commit
bd48cb1
Β·
verified Β·
1 Parent(s): 27c3d84

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +72 -10
README.md CHANGED
@@ -1,13 +1,75 @@
1
  ---
2
- title: Project2
3
- emoji: 😻
4
- colorFrom: gray
5
- colorTo: blue
6
- sdk: gradio
7
- sdk_version: 5.18.0
8
- app_file: app.py
9
- pinned: false
10
  license: apache-2.0
 
 
11
  ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
 
 
 
 
 
 
 
2
  license: apache-2.0
3
+ title: 'HeadlinesGen:Partmone '
4
+ sdk: gradio
5
  ---
6
+ Final Project: Part One
7
+ Headlines Generation Project:
8
+ This project is all about making it easier to come up with the perfect headline. The goal is to
9
+ create an app that helps generate clear, engaging, and relevant headlines for articles in both
10
+ Arabic and English. Instead of struggling to summarize an article, users can get an instant, wellmatched headline with just a click. The app is designed to be simple and efficient, allowing
11
+ users to choose their preferred language and quickly get the best possible headline with
12
+ generated audio without the hassle.
13
+ Pipelines:
14
+ Headlines Generator:
15
+ β€’ The app generates headlines based on the provided article text in English using the
16
+ Michau/t5-base-en-generate-headline model.
17
+ β€’ If the input is in English, the headline is generated directly in English.
18
+ Translation:
19
+ β€’ If the input is in Arabic, it is first translated to English using Helsinki-NLP/opus-mt-aren, then the headline is generated in English, and finally, it is translated back to Arabic
20
+ using Helsinki-NLP/opus-mt-en-ar.
21
+ β€’ This ensures the app provides a headline in the desired language, whether the input
22
+ is in English or Arabic.
23
+ Text-to-Speech:
24
+ β€’ The app supports text-to-speech conversion for both English and Arabic.
25
+ β€’ Arabic: To convert the Arabic headline to speech using facebook/mms-tts-ara.
26
+ β€’ English: To convert the English headline to speech using microsoft/speecht5_tts.
27
+ How to use the interface:
28
+ The app uses Gradio for building a simple interface where users can select the language, input
29
+ text, and receive the generated headline with an audio.
30
+ Select Language: Choose between Arabic or English.
31
+ Enter Article Text: Type or paste the article text from which you want to generate a
32
+ headline.
33
+ Get Headline: Once the button is clicked, a headline will be generated.
34
+ Get Audio: An audio of the headline also will be generated.
35
+ Example Input:
36
+ Select Language: English
37
+ Text/Article: " Greenhouse gas emissions, primarily carbon dioxide (CO2) and methane
38
+ (CH4), are the main drivers of global climate change. Human activities, such as burning fossil
39
+ fuels for energy, deforestation, and industrial processes, have significantly increased the
40
+ concentration of these gases in the atmosphere. According to the Intergovernmental Panel
41
+ on Climate Change (IPCC), CO2 levels have risen by over 50% since the pre-industrial era,
42
+ contributing to rising global temperatures. "
43
+ Expected Output (A headline in English): Global Warming - The Main Driver of Global
44
+ Climate Change.
45
+ An audio that read the headline.
46
+ Why We Chose These Models:
47
+ Headlines Generator:
48
+ We selected Michau/t5-base-en-generate-headline for headline generation because it has
49
+ been trained on a collection of 500,000 articles with corresponding headings, making it wellsuited for this task. The model is specifically designed to generate concise and relevant
50
+ headlines from article text.
51
+ Translation:
52
+ We use the Helsinki-NLP/opus-mt-ar-en and Helsinki-NLP/opus-mt-en-ar models to
53
+ translate back and forth between Arabic and English. Since the main headline generation
54
+ model does not support Arabic, we had to find a way to generate headlines in Arabic.
55
+ To achieve this, we first translate Arabic input into English so that the headline generation
56
+ model can process it and produce a proper English headline. Since we want the headline to
57
+ match the article's original language, we then translate the generated English headline back
58
+ into Arabic before outputting it.
59
+ Because translation accuracy is crucial for maintaining the meaning of the headlines, we
60
+ carefully selected our translation models based on popularity and high download rates,
61
+ ensuring they are optimized specifically for Arabic and English.
62
+ Text-to-speech:
63
+ Arabic Text-to-Speech: We selected facebook/mms-tts-ara for Arabic text-to-speech after
64
+ evaluating multiple models. This model provided the best pronunciation and clarity, ensuring
65
+ high-quality Arabic speech.
66
+ English Text-to-Speech: We chose microsoft/speecht5_tts for English text-to-speech due to
67
+ its superior pronunciation and clarity. As a Microsoft-developed model, it leverages state-ofthe-art technology to produce natural and highly reliable speech, making it an ideal choice
68
+ for our project.
69
+ Special Measures Taken to Support the Arabic Language:
70
+ Since our chosen headline generation model Michau/t5-base-en-generate-headline only
71
+ supports English, we implemented a translation pipeline to ensure that Arabic inputs can be
72
+ processed effectively.
73
+ To achieve this, we use the Helsinki-NLP/opus-mt-ar-en model to translate Arabic text into
74
+ English before generating a headline. Once the headline is created in English, we then use
75
+ the Helsinki-NLP/opus-mt-en-ar model to translate it back into Arabic