Skip to content

Commit

Permalink
Merge pull request #84 from MAIF/features/github_actions
Browse files Browse the repository at this point in the history
Closes #83
  • Loading branch information
TFA-MAIF committed Jun 7, 2021
2 parents a392d75 + 74aa455 commit 0a40ab5
Show file tree
Hide file tree
Showing 12 changed files with 167 additions and 138 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build & Test
on: push

jobs:
build_test_publish:
name: "Build & Test"
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: [3.6]
steps:
- uses: actions/checkout@v2
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install flake8 pytest
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- name: Build python package
run: |
python setup.py sdist bdist_wheel
- name: Deploy to PyPI
if: success() && startsWith(github.ref, 'refs/tags') && matrix.python-version == 3.6
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion melusine/summarizer/keywords_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(
n_docs_in_class=100,
keywords_coef=10,
):
self.max_tfidf_features_ = max_tfidf_features
self.max_tfidf_features = max_tfidf_features
self.tfidf_vectorizer = TfidfVectorizer(max_features=max_tfidf_features)
self.keywords = keywords
self.stopwords = stopwords
Expand Down
14 changes: 13 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@ flake8==3.5.0
numpydoc==0.8.0
Sphinx==3.0.4
sphinx-bootstrap-theme==0.6.5
tox==3.5.2
twine==3.2.0
psutil>=5.7.0
pytest==3.8.2
pytest-runner==4.2
watchdog==0.9.0
wheel==0.32.1
pandas>=0.25.0
scikit-learn>=0.19.0
gensim>=4.0.0
tqdm>=4.34
streamlit>=0.57.3
tensorflow>=2.2.0
transformers==3.4.0
unidecode>=1.0
flashtext>=2.7
plotly
h5py==2.10.0
numpy>=1.16.4,<1.19.0
joblib>=1.0


Empty file added tests/__init__.py
Empty file.
Empty file.
Empty file added tests/unit_tests/__init__.py
Empty file.
Empty file.
Empty file.
29 changes: 0 additions & 29 deletions tox.ini

This file was deleted.

47 changes: 28 additions & 19 deletions tutorial/tutorial06_keywordsgenerator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -162,21 +162,23 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"KeywordsGenerator(copy=True, keywords=['devis', 'contrat', 'resilitation'],\n",
" keywords_coef=10, max_tfidf_features=None, n_docs_in_class=100,\n",
" n_jobs=20, n_max_keywords=5, n_min_keywords=0, progress_bar=True,\n",
" resample=False,\n",
" stopwords=(['au', 'aux', 'avec', 'ce', 'ces', 'dans', 'de', 'des', 'du', 'elle', 'en', 'et', 'eux', 'il', 'je', 'la', 'le', 'leur', 'lui', 'ma', 'mais', 'me', 'même', 'mes', 'moi', 'mon', 'ne', 'nos', 'notre', 'nous', 'on', 'ou', 'par', 'pas', 'pour', 'qu', 'que', 'qui', 'sa', 'se', 'ses', 'son', 's..., 'ayons', 'ayez', 'aient', 'eusse', 'eusses', 'eût', 'eussions', 'eussiez', 'eussent', 'suivant'],),\n",
" threshold_keywords=0.1)"
"KeywordsGenerator(keywords=['devis', 'contrat', 'resilitation'],\n",
" n_max_keywords=5,\n",
" stopwords=(['au', 'aux', 'avec', 'ce', 'ces', 'dans', 'de',\n",
" 'des', 'du', 'elle', 'en', 'et', 'eux', 'il',\n",
" 'je', 'la', 'le', 'leur', 'lui', 'ma', 'mais',\n",
" 'me', 'même', 'mes', 'moi', 'mon', 'ne', 'nos',\n",
" 'notre', 'nous', ...],),\n",
" threshold_keywords=0.1)"
]
},
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -194,7 +196,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -203,7 +205,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -277,7 +279,7 @@
"4 [ci, joint, bulletin, salaire, comme] "
]
},
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -288,7 +290,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -316,7 +318,7 @@
" 'lassurance']"
]
},
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -327,7 +329,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand All @@ -336,21 +338,28 @@
"['nouvelle', 'immatriculation', 'prie', 'trouver', 'faire']"
]
},
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_emails_preprocessed.keywords[1]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "emails_prod_without_melusine",
"display_name": "sentiment",
"language": "python",
"name": "emails_prod_without_melusine"
"name": "sentiment"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -362,7 +371,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.6.13"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 0a40ab5

Please sign in to comment.