Spaces:
Runtime error
Runtime error
Nguyen Quang Truong
commited on
Commit
·
93ea493
1
Parent(s):
723e191
[Update_KG]
Browse files
.github/workflows/scrape.yml
CHANGED
@@ -36,3 +36,35 @@ jobs:
|
|
36 |
git push
|
37 |
env:
|
38 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
git push
|
37 |
env:
|
38 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
- name: Pull latest changes
|
43 |
+
run: git pull origin main
|
44 |
+
|
45 |
+
- name: Create .env file to store API key
|
46 |
+
run: |
|
47 |
+
echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> ./.env
|
48 |
+
echo "NEO4J_URI=${{ secrets.NEO4J_URI }}" >> ./.env
|
49 |
+
echo "NEO4J_USERNAME=${{ secrets.NEO4J_USERNAME }}" >> ./.env
|
50 |
+
echo "NEO4J_PASSWORD=${{ secrets.NEO4J_PASSWORD }}" >> ./.env
|
51 |
+
|
52 |
+
|
53 |
+
- name: Run Python scripts to update KG
|
54 |
+
run: python update_kg.py
|
55 |
+
|
56 |
+
- name: Remove file .env
|
57 |
+
run: rm ./.env
|
58 |
+
|
59 |
+
- name: Commit files
|
60 |
+
run: |
|
61 |
+
git config --local user.email "action@github.com"
|
62 |
+
git config --local user.name "GitHub Action"
|
63 |
+
git add -A
|
64 |
+
git diff-index --quiet HEAD || (git commit -a -m "updated logs" --allow-empty)
|
65 |
+
|
66 |
+
- name: Push changes
|
67 |
+
uses: ad-m/github-push-action@v0.6.0
|
68 |
+
with:
|
69 |
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
70 |
+
branch: main
|
Knowledge_Graph/update_knowledge_graph.py
CHANGED
@@ -2,7 +2,8 @@ from config import configure_setup
|
|
2 |
from classNode import JobKnowledgeGraph
|
3 |
from cypher_utils import make_cypher_query
|
4 |
from process_data import get_job_desc
|
5 |
-
from datetime import
|
|
|
6 |
|
7 |
|
8 |
|
@@ -33,7 +34,9 @@ if __name__ == "__main__":
|
|
33 |
# knowledge_graph.query(delete_cypher)
|
34 |
|
35 |
# filename = f"job_posts_data/job_posts_artificial_intelligence_{str(date.today())}.json"
|
36 |
-
|
|
|
|
|
37 |
|
38 |
n_processed = 0
|
39 |
job_desc = get_job_desc(filename)
|
|
|
2 |
from classNode import JobKnowledgeGraph
|
3 |
from cypher_utils import make_cypher_query
|
4 |
from process_data import get_job_desc
|
5 |
+
from datetime import datetime
|
6 |
+
# from datetime import date
|
7 |
|
8 |
|
9 |
|
|
|
34 |
# knowledge_graph.query(delete_cypher)
|
35 |
|
36 |
# filename = f"job_posts_data/job_posts_artificial_intelligence_{str(date.today())}.json"
|
37 |
+
|
38 |
+
today = datetime.today().strftime('%Y_%m_%d')
|
39 |
+
filename = f"./data/data_{today}.json"
|
40 |
|
41 |
n_processed = 0
|
42 |
job_desc = get_job_desc(filename)
|