OxbridgeEconomics
commited on
Commit
·
b8e1f0f
1
Parent(s):
57c4050
commit
Browse files- .github/workflows/china gov.yml +46 -0
- utils.py +5 -5
.github/workflows/china gov.yml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
2 |
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
3 |
+
|
4 |
+
name: Data Collection - China GOV
|
5 |
+
|
6 |
+
on:
|
7 |
+
# schedule:
|
8 |
+
# - cron: '0 16 * * *'
|
9 |
+
workflow_dispatch:
|
10 |
+
|
11 |
+
permissions:
|
12 |
+
contents: read
|
13 |
+
|
14 |
+
jobs:
|
15 |
+
build:
|
16 |
+
runs-on: ubuntu-latest
|
17 |
+
timeout-minutes: 14400
|
18 |
+
steps:
|
19 |
+
- uses: actions/checkout@v3
|
20 |
+
- name: Set up Python 3.10
|
21 |
+
uses: actions/setup-python@v3
|
22 |
+
with:
|
23 |
+
python-version: "3.10"
|
24 |
+
- name: Install dependencies
|
25 |
+
run: |
|
26 |
+
python -m pip install --upgrade pip
|
27 |
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
28 |
+
pip install transformers
|
29 |
+
pip install tensorflow
|
30 |
+
pip install tf-keras
|
31 |
+
- name: Data Collection
|
32 |
+
env:
|
33 |
+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
34 |
+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
35 |
+
run: |
|
36 |
+
python cbirc.py
|
37 |
+
python chinatax.py
|
38 |
+
python csrc.py
|
39 |
+
python mof.py
|
40 |
+
python gov.py
|
41 |
+
python mofcom.py
|
42 |
+
python ndrc.py
|
43 |
+
python pbc.py
|
44 |
+
python safe.py
|
45 |
+
python stats.py
|
46 |
+
python eastmoney.py
|
utils.py
CHANGED
@@ -9,10 +9,10 @@ from googletrans import Translator
|
|
9 |
from transformers import pipeline
|
10 |
from PyPDF2 import PdfReader
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
AWS_ACCESS_KEY_ID="AKIAQFXZMGHQYXKWUDWR"
|
15 |
-
AWS_SECRET_ACCESS_KEY="D2A0IEVl5g3Ljbu0Y5iq9WuFETpDeoEpl69C+6xo"
|
16 |
|
17 |
analyzer = pipeline("sentiment-analysis", model="ProsusAI/finbert")
|
18 |
|
@@ -122,7 +122,7 @@ def sentiment_computation(content):
|
|
122 |
def upsert_content(report):
|
123 |
"""Upsert the content records"""
|
124 |
dynamodb = get_db_connection()
|
125 |
-
table = dynamodb.Table('
|
126 |
# Define the item data
|
127 |
item = {
|
128 |
'id': str(report['id']),
|
|
|
9 |
from transformers import pipeline
|
10 |
from PyPDF2 import PdfReader
|
11 |
|
12 |
+
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
|
13 |
+
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
|
14 |
+
# AWS_ACCESS_KEY_ID="AKIAQFXZMGHQYXKWUDWR"
|
15 |
+
# AWS_SECRET_ACCESS_KEY="D2A0IEVl5g3Ljbu0Y5iq9WuFETpDeoEpl69C+6xo"
|
16 |
|
17 |
analyzer = pipeline("sentiment-analysis", model="ProsusAI/finbert")
|
18 |
|
|
|
122 |
def upsert_content(report):
|
123 |
"""Upsert the content records"""
|
124 |
dynamodb = get_db_connection()
|
125 |
+
table = dynamodb.Table('article_test')
|
126 |
# Define the item data
|
127 |
item = {
|
128 |
'id': str(report['id']),
|