Skip to content

Commit d2a1ae6

Browse files
committed
refactor: renomeia services
1 parent f8fd075 commit d2a1ae6

File tree

6 files changed

+35
-35
lines changed

6 files changed

+35
-35
lines changed

.github/workflows/extrai_fatos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
steps:
99
- uses: actions/checkout@v4
1010
- name: Build container
11-
run: DOCKER_BUILDKIT=1 docker build --tag ptoie_python .
11+
run: DOCKER_BUILDKIT=1 docker build --tag dptoie_python .
1212

1313
- name: Run all inputs with all configurations
1414
run: |
@@ -37,7 +37,7 @@ jobs:
3737
echo "[JSON] input=$filename flags=[$flags]"
3838
# remove stale json output if any
3939
rm -f ./outputs/output.json
40-
docker run --rm -v "$(pwd)":/ptoie_python ptoie_python poetry run python3 src/main.py -i "$input_path" $input_args $flags || echo "json-run-failed for $filename $flags"
40+
docker run --rm -v "$(pwd)":/dptoie_python dptoie_python poetry run python3 src/main.py -i "$input_path" $input_args $flags || echo "json-run-failed for $filename $flags"
4141
4242
# compute cleaned suffix for filename (empty => base name only)
4343
if [[ -z "$flags" ]]; then
@@ -58,7 +58,7 @@ jobs:
5858
echo "[CSV] input=$filename flags=[$flags]"
5959
# remove stale csv output if any
6060
rm -f ./outputs/output.csv
61-
docker run --rm -v "$(pwd)":/ptoie_python ptoie_python poetry run python3 src/main.py -i "$input_path" $input_args $flags -o ./outputs/output.csv -ot csv || echo "csv-run-failed for $filename $flags"
61+
docker run --rm -v "$(pwd)":/dptoie_python dptoie_python poetry run python3 src/main.py -i "$input_path" $input_args $flags -o ./outputs/output.csv -ot csv || echo "csv-run-failed for $filename $flags"
6262
6363
if [[ -z "$flags" ]]; then
6464
out_csv="./outputs/${name}.csv"

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
FROM python:3.12-slim
22

3-
WORKDIR /ptoie_python
3+
WORKDIR /dptoie_python
44

5-
COPY pyproject.toml poetry.lock /ptoie_python/
5+
COPY pyproject.toml poetry.lock /dptoie_python/
66
RUN pip install poetry \
77
&& poetry config virtualenvs.create false \
88
&& poetry install --only main --no-root --no-directory
9-
COPY . /ptoie_python
9+
COPY . /dptoie_python
1010
RUN poetry install --only main
1111

12-
ENV PYTHONPATH="$PYTHONPATH:/ptoie_python"
12+
ENV PYTHONPATH="$PYTHONPATH:/dptoie_python"
1313

1414
CMD [ "poetry", "run", "python3", "src/noie.py" ]

README-ptbr.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,27 @@ Saídas esperadas:
102102

103103
Build da imagem (na raiz do projeto):
104104
```bash
105-
docker build -t ptoie_python .
105+
docker build -t dptoie_python .
106106
```
107107

108108
Executar um comando pontual (mapeando o diretório atual e apontando para os arquivos dentro do container):
109109
```bash
110110
docker run --rm -it \
111-
-e STANZA_RESOURCES_DIR=/ptoie_python/models/.stanza_resources \
112-
-v "$(pwd)":/ptoie_python \
113-
-w /ptoie_python \
114-
ptoie_python \
115-
poetry run python3 src/main.py -i /ptoie_python/inputs/teste.conll -it conll -o /ptoie_python/outputs/out.json -ot json -cc -sc -a -t
111+
-e STANZA_RESOURCES_DIR=/dptoie_python/models/.stanza_resources \
112+
-v "$(pwd)":/dptoie_python \
113+
-w /dptoie_python \
114+
dptoie_python \
115+
poetry run python3 src/main.py -i /dptoie_python/inputs/teste.conll -it conll -o /dptoie_python/outputs/out.json -ot json -cc -sc -a -t
116116
```
117117

118118
Observação: ajuste os caminhos de `-i` e `-o` conforme necessário; use `-it txt` quando a entrada for texto linha-a-linha.
119119

120120
## Como executar com Docker Compose
121121

122-
O arquivo `docker-compose.yml` já inclui o serviço `ptoie_python`. Você pode editar a linha `command:` para o cenário desejado. Exemplo de comando recomendado:
122+
O arquivo `docker-compose.yml` já inclui o serviço `dptoie_python`. Você pode editar a linha `command:` para o cenário desejado. Exemplo de comando recomendado:
123123

124124
```yaml
125-
command: poetry run python3 src/main.py -i /ptoie_python/inputs/teste.conll -it conll -o /ptoie_python/outputs/out.json -ot json -cc -sc -a -t
125+
command: poetry run python3 src/main.py -i /dptoie_python/inputs/teste.conll -it conll -o /dptoie_python/outputs/out.json -ot json -cc -sc -a -t
126126
```
127127

128128
Então rode:
@@ -132,21 +132,21 @@ docker compose up --build
132132

133133
Use o comando `run` para executar outros comandos personalizados:
134134
```bash
135-
docker compose run ptoie_python poetry run python3 src/main.py -i /ptoie_python/inputs/ceten-200.txt -it txt -o /ptoie_python/outputs/out.csv -ot csv -cc
135+
docker compose run dptoie_python poetry run python3 src/main.py -i /dptoie_python/inputs/ceten-200.txt -it txt -o /dptoie_python/outputs/out.csv -ot csv -cc
136136
```
137137

138138

139139

140140
Dicas:
141-
- O volume `.:/ptoie_python` permite usar arquivos da pasta local dentro do container.
141+
- O volume `.:/dptoie_python` permite usar arquivos da pasta local dentro do container.
142142
- `STANZA_RESOURCES_DIR` (exposto no compose) pode apontar para `models/.stanza_resources` para evitar downloads repetidos.
143143

144144
## Referências rápidas
145145

146146
- Entrada TXT: cada linha é uma sentença; o sistema cria um `.conll` temporário.
147147
- Entrada CoNLL-U: use `-it conll` e garanta sentenças separadas por linha vazia.
148148
- Ativação das regras: todas desativadas por padrão; adicione as flags desejadas.
149-
- Caminhos relativos são interpretados a partir da raiz do projeto; no Docker, use caminhos absolutos dentro do container (ex.: `/ptoie_python/...`).
149+
- Caminhos relativos são interpretados a partir da raiz do projeto; no Docker, use caminhos absolutos dentro do container (ex.: `/dptoie_python/...`).
150150

151151
## Como citar este projeto
152152
Se você utilizar este projeto em sua pesquisa, por favor, cite-o da seguinte forma:

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,27 @@ Expected outputs:
101101

102102
Build the image (from the project root):
103103
```bash
104-
docker build -t ptoie_python .
104+
docker build -t dptoie_python .
105105
```
106106

107107
Run a one-off command (mounting the current directory and pointing to files inside the container):
108108
```bash
109109
docker run --rm -it \
110-
-e STANZA_RESOURCES_DIR=/ptoie_python/models/.stanza_resources \
111-
-v "$(pwd)":/ptoie_python \
112-
-w /ptoie_python \
113-
ptoie_python \
114-
poetry run python3 src/main.py -i /ptoie_python/inputs/teste.conll -it conll -o /ptoie_python/outputs/out.json -ot json -cc -sc -a -t
110+
-e STANZA_RESOURCES_DIR=/dptoie_python/models/.stanza_resources \
111+
-v "$(pwd)":/dptoie_python \
112+
-w /dptoie_python \
113+
dptoie_python \
114+
poetry run python3 src/main.py -i /dptoie_python/inputs/teste.conll -it conll -o /dptoie_python/outputs/out.json -ot json -cc -sc -a -t
115115
```
116116

117117
Note: adjust the `-i` and `-o` paths as needed; use `-it txt` when the input is line-by-line text.
118118

119119
## How to run with Docker Compose
120120

121-
The `docker-compose.yml` file already includes the `ptoie_python` service. You can edit the `command:` line for the desired scenario. Example recommended command:
121+
The `docker-compose.yml` file already includes the `dptoie_python` service. You can edit the `command:` line for the desired scenario. Example recommended command:
122122

123123
```yaml
124-
command: poetry run python3 src/main.py -i /ptoie_python/inputs/teste.conll -it conll -o /ptoie_python/outputs/out.json -ot json -cc -sc -a -t
124+
command: poetry run python3 src/main.py -i /dptoie_python/inputs/teste.conll -it conll -o /dptoie_python/outputs/out.json -ot json -cc -sc -a -t
125125
```
126126
127127
Then run:
@@ -131,19 +131,19 @@ docker compose up --build
131131

132132
Use `run` to execute other custom commands:
133133
```bash
134-
docker compose run ptoie_python poetry run python3 src/main.py -i /ptoie_python/inputs/ceten-200.txt -it txt -o /ptoie_python/outputs/out.csv -ot csv -cc
134+
docker compose run dptoie_python poetry run python3 src/main.py -i /dptoie_python/inputs/ceten-200.txt -it txt -o /dptoie_python/outputs/out.csv -ot csv -cc
135135
```
136136

137137
Tips:
138-
- The volume `.:/ptoie_python` allows using local files inside the container.
138+
- The volume `.:/dptoie_python` allows using local files inside the container.
139139
- `STANZA_RESOURCES_DIR` (exposed in the compose file) can point to `models/.stanza_resources` to avoid repeated downloads.
140140

141141
## Quick references
142142

143143
- TXT input: each line is a sentence; the system creates a temporary `.conll`.
144144
- CoNLL-U input: use `-it conll` and ensure sentences are separated by an empty line.
145145
- Rule activation: all rules are disabled by default; add the desired flags.
146-
- Relative paths are interpreted from the project root; in Docker, use absolute paths inside the container (e.g., `/ptoie_python/...`).
146+
- Relative paths are interpreted from the project root; in Docker, use absolute paths inside the container (e.g., `/dptoie_python/...`).
147147

148148

149149
## How to cite

docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
services:
2-
ptoie_python:
2+
dptoie_python:
33
build:
44
context: .
55
dockerfile: Dockerfile
6-
container_name: ptoie_python
6+
container_name: dptoie_python
77
volumes:
8-
- .:/ptoie_python
9-
command: poetry run python3 src/main.py -i /ptoie_python/inputs/teste.conll -it conll -o /ptoie_python/outputs/output.json -ot json -cc -sc -hs -a -t
8+
- .:/dptoie_python
9+
command: poetry run python3 src/main.py -i /dptoie_python/inputs/teste.conll -it conll -o /dptoie_python/outputs/output.json -ot json -cc -sc -hs -a -t
1010
environment:
11-
- STANZA_RESOURCES_DIR=/ptoie_python/models/.stanza_resources
11+
- STANZA_RESOURCES_DIR=/dptoie_python/models/.stanza_resources

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.poetry]
2-
name = "ptoie_python"
2+
name = "dptoie_python"
33
version = "0.1.0"
44
description = "DPToie-Python is an Open Information Extractor for Portuguese language that employs Dependence Parser and Part of Speech Tagger models with Stanford CoreNLP."
55
authors = ["André Walker <andre.walker@ufba.br>", "Rafael Glauber <rafaelglauber@gmail.com>", "Daniela Barreiro Claro <dclaro.@ufba.br>"]

0 commit comments

Comments
 (0)