Muhammad Haris commited on
Commit
a23c731
Β·
verified Β·
1 Parent(s): b68f0a0

Upload 5 files

Browse files
Files changed (5) hide show
  1. README.md +8 -5
  2. gitattributes +35 -0
  3. gitignore +2 -0
  4. requirements.txt +4 -0
  5. wna_googlenews.py +22 -0
README.md CHANGED
@@ -1,13 +1,16 @@
1
  ---
2
- title: NewsDistil
3
- emoji: πŸŒ–
4
- colorFrom: indigo
5
- colorTo: pink
6
  sdk: streamlit
7
- sdk_version: 1.36.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
 
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: World News Analysis
3
+ emoji: 🌍
4
+ colorFrom: yellow
5
+ colorTo: blue
6
  sdk: streamlit
7
+ sdk_version: 1.31.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
+ models:
12
+ - j-hartmann/emotion-english-distilroberta-base
13
+ - SamLowe/roberta-base-go_emotions
14
  ---
15
 
16
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ __pycache__/**
2
+ .env
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ GoogleNews
2
+ pandas
3
+ torch
4
+ transformers
wna_googlenews.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # https://github.com/Iceloof/GoogleNews
3
+ from GoogleNews import GoogleNews
4
+ import pandas as pd
5
+
6
+ # get the news with lang and country parameters
7
+ def get_news(settings, query):
8
+ googlenews = GoogleNews(
9
+ lang=settings["lang"],
10
+ region=settings["region"],
11
+ period=settings["period"],
12
+ )
13
+ number_of_pages = settings["number_of_pages"]
14
+ # get each pages
15
+ final_list = []
16
+ googlenews.search(query)
17
+ print("Total Pages: ", googlenews.total_count())
18
+ for page in range(1, number_of_pages + 1):
19
+ page_result = googlenews.page_at(page)
20
+ # merge dat
21
+ final_list = final_list + page_result
22
+ return final_list