-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (58 loc) · 2.2 KB
/
populate_labelstudio.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Populate LabelStudio
on:
workflow_dispatch:
inputs:
crawl_id:
description: 'Common Crawl Corpus'
required: true
default: 'CC-MAIN-2024-10'
url:
description: 'URL type'
required: true
default: '*.gov'
keyword:
description: 'keyword'
required: true
default: 'police'
pages:
description: 'num pages'
required: true
default: '2'
record_type:
description: 'record type'
required: false
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r annotation_pipeline/requirements.txt
- name: Run main script
env:
HUGGINGFACE_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}
LABEL_STUDIO_ACCESS_TOKEN: ${{ secrets.LABEL_STUDIO_ACCESS_TOKEN }}
LABEL_STUDIO_PROJECT_ID: ${{ secrets.LABEL_STUDIO_PROJECT_ID }}
LABEL_STUDIO_ORGANIZATION: ${{ secrets.LABEL_STUDIO_ORGANIZATION }}
run: |
if [ -n "${{ github.event.inputs.record_type }}" ]; then
python annotation_pipeline/populate_labelstudio.py ${{ github.event.inputs.crawl_id }} "${{ github.event.inputs.url }}" ${{ github.event.inputs.keyword }} --pages ${{ github.event.inputs.pages }} --record_type "${{ github.event.inputs.record_type }}"
else
python annotation_pipeline/populate_labelstudio.py ${{ github.event.inputs.crawl_id }} "${{ github.event.inputs.url }}" ${{ github.event.inputs.keyword }} --pages ${{ github.event.inputs.pages }}
fi
- name: Commit and push outputs
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "[email protected]"
git add annotation_pipeline/data/batch_info.csv
git add annotation_pipeline/data/cache.json
git add annotation_pipeline/data/tag_collector/*
git commit -m "Update batch info and collected urls & tags"
git push