-
Notifications
You must be signed in to change notification settings - Fork 247
Yake Refactoring .1 #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Teste de linting nos ficheiros atuais do yake
testes gerais
refatorização inicial do programa principal
criado workflow para verificar resultados
atualização resultados.yml
atualizado resultados.yml
atualizado status adicionados ficheiros originais para comparações
Removidos ficheiros originais, pois estavam a interferir com o score do teste pylint
highligths.py 90%
só falta refatorar variáveis, reconstruir métodos e documentação
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the repository by removing legacy Docker setups and demos, and introduces improved documentation, a Makefile for common tasks, and enhanced CI/CD pipelines.
- Removed outdated Dockerfiles, REST API example, and demo application
- Overhauled README with new installation and usage instructions
- Added Makefile and GitHub Actions workflows for install, lint, test, format, and deployment
Reviewed Changes
Copilot reviewed 155 out of 155 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| docker/Dockerfiles/yake/Dockerfile | Removed legacy YAKE CLI Dockerfile |
| demo/streamlit_app.py | Deleted demo Streamlit application |
| README.md | Revamped installation, usage, and documentation |
| Makefile | Added Makefile for build/test/format/lint tasks |
| .github/workflows/deploy.yml | New deployment workflow for GitHub Pages |
| uv pip install git+https://github.com/LIAAD/yake | ||
| ``` | ||
| *Example text from Wikipedia* | ||
|
|
||
| <a name="rest-api-image"></a> | ||
| ### Option 2. REST API Server in a Docker container | ||
|
|
||
| This install will provide you a mirror of the original REST API of YAKE! available [here](https://boiling-castle-88317.herokuapp.com). | ||
| or | ||
|
|
||
| ```bash | ||
| docker run -p 5000:5000 -d liaad/yake-server:latest | ||
| ``` | ||
|
|
||
| After it starts up, the container will run in the background, at http://127.0.0.1:5000. To access the YAKE! API documentation, go to http://127.0.0.1:5000/apidocs/. | ||
|
|
||
| You can test the RESTful API using `curl`: | ||
|
|
||
| ```bash | ||
| curl -X POST "http://localhost:5000/yake/" -H "accept: application/json" -H "Content-Type: application/json" \ | ||
| -d @- <<'EOF' | ||
| { | ||
| "language": "en", | ||
| "max_ngram_size": 3, | ||
| "number_of_keywords": 10, | ||
| "text": "Sources tell us that Google is acquiring Kaggle, a platform that hosts data science and machine learning competitions. Details about the transaction remain somewhat vague , but given that Google is hosting its Cloud Next conference in San Francisco this week, the official announcement could come as early as tomorrow. Reached by phone, Kaggle co-founder CEO Anthony Goldbloom declined to deny that the acquisition is happening. Google itself declined 'to comment on rumors'. Kaggle, which has about half a million data scientists on its platform, was founded by Goldbloom and Ben Hamner in 2010. The service got an early start and even though it has a few competitors like DrivenData, TopCoder and HackerRank, it has managed to stay well ahead of them by focusing on its specific niche. The service is basically the de facto home for running data science and machine learning competitions. With Kaggle, Google is buying one of the largest and most active communities for data scientists ..." | ||
| } | ||
| EOF | ||
| ``` | ||
| *Example text from Wikipedia* | ||
|
|
||
| <a name="standalone-installation"></a> | ||
| ### Option 3. Standalone Installation (for development or integration) | ||
|
|
||
| #### Requirements | ||
|
|
||
| Python3 | ||
|
|
||
| #### Installation | ||
|
|
||
| To install Yake using pip: | ||
|
|
||
| ``` bash | ||
| pip install git+https://github.com/LIAAD/yake | ||
| uv pip install yake |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command prefix uv is unclear. If this is not an alias defined elsewhere, consider replacing it with a standard pip install invocation or documenting the alias.
| uv pip install git+https://github.com/LIAAD/yake | ||
| ``` | ||
| *Example text from Wikipedia* | ||
|
|
||
| <a name="rest-api-image"></a> | ||
| ### Option 2. REST API Server in a Docker container | ||
|
|
||
| This install will provide you a mirror of the original REST API of YAKE! available [here](https://boiling-castle-88317.herokuapp.com). | ||
| or | ||
|
|
||
| ```bash | ||
| docker run -p 5000:5000 -d liaad/yake-server:latest | ||
| ``` | ||
|
|
||
| After it starts up, the container will run in the background, at http://127.0.0.1:5000. To access the YAKE! API documentation, go to http://127.0.0.1:5000/apidocs/. | ||
|
|
||
| You can test the RESTful API using `curl`: | ||
|
|
||
| ```bash | ||
| curl -X POST "http://localhost:5000/yake/" -H "accept: application/json" -H "Content-Type: application/json" \ | ||
| -d @- <<'EOF' | ||
| { | ||
| "language": "en", | ||
| "max_ngram_size": 3, | ||
| "number_of_keywords": 10, | ||
| "text": "Sources tell us that Google is acquiring Kaggle, a platform that hosts data science and machine learning competitions. Details about the transaction remain somewhat vague , but given that Google is hosting its Cloud Next conference in San Francisco this week, the official announcement could come as early as tomorrow. Reached by phone, Kaggle co-founder CEO Anthony Goldbloom declined to deny that the acquisition is happening. Google itself declined 'to comment on rumors'. Kaggle, which has about half a million data scientists on its platform, was founded by Goldbloom and Ben Hamner in 2010. The service got an early start and even though it has a few competitors like DrivenData, TopCoder and HackerRank, it has managed to stay well ahead of them by focusing on its specific niche. The service is basically the de facto home for running data science and machine learning competitions. With Kaggle, Google is buying one of the largest and most active communities for data scientists ..." | ||
| } | ||
| EOF | ||
| ``` | ||
| *Example text from Wikipedia* | ||
|
|
||
| <a name="standalone-installation"></a> | ||
| ### Option 3. Standalone Installation (for development or integration) | ||
|
|
||
| #### Requirements | ||
|
|
||
| Python3 | ||
|
|
||
| #### Installation | ||
|
|
||
| To install Yake using pip: | ||
|
|
||
| ``` bash | ||
| pip install git+https://github.com/LIAAD/yake | ||
| uv pip install yake |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to above, the uv prefix is ambiguous to users. Update to pip install yake or explain what uv refers to in this context.
| --help Show this message and exit. | ||
| ``` | ||
| Dont know which Deduplication function to use, see more [here](https://tiagolv.github.io/yakerf/docs/-getting-started#keyword-deduplication-methods) |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Dont should be Don't (with an apostrophe).
| Dont know which Deduplication function to use, see more [here](https://tiagolv.github.io/yakerf/docs/-getting-started#keyword-deduplication-methods) | |
| Don't know which Deduplication function to use, see more [here](https://tiagolv.github.io/yakerf/docs/-getting-started#keyword-deduplication-methods) |
| on: | ||
| push: | ||
| branches: | ||
| - core-seperation # ou master, dependendo da sua branch principal |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misspelling: core-seperation should be core-separation.
| - core-seperation # ou master, dependendo da sua branch principal | |
| - core-separation # ou master, dependendo da sua branch principal |
| uv pip install --upgrade pip | ||
| uv pip install -e . | ||
|
|
||
| install-dev: | ||
| uv pip install --upgrade pip | ||
| uv pip install -e ".[dev]" | ||
|
|
||
| test: | ||
| uv run pytest -vv --cov=yake test_*.py | ||
|
|
||
| format: | ||
| uv run black . | ||
|
|
||
| lint: | ||
| uv run ruff check --fix . | ||
| uv run ruff check . | ||
| uv run flake8 yake/ |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The uv prefix is not a standard command; consider using python -m pip install --upgrade pip or explain uv if it's an alias.
| uv pip install --upgrade pip | |
| uv pip install -e . | |
| install-dev: | |
| uv pip install --upgrade pip | |
| uv pip install -e ".[dev]" | |
| test: | |
| uv run pytest -vv --cov=yake test_*.py | |
| format: | |
| uv run black . | |
| lint: | |
| uv run ruff check --fix . | |
| uv run ruff check . | |
| uv run flake8 yake/ | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . | |
| install-dev: | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[dev]" | |
| test: | |
| pytest -vv --cov=yake test_*.py | |
| format: | |
| black . | |
| lint: | |
| ruff check --fix . | |
| ruff check . | |
| flake8 yake/ |
| name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master |
Copilot
AI
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referencing the master branch in an action version is unstable. It’s recommended to pin to a specific version or tag (e.g., actions/checkout@v3).
| - uses: actions/checkout@master | |
| - uses: actions/checkout@v3 |
Refactored code, added documentation ,updated readme, better CI/CD pipelin, new webpage with documentation and new links