Skip to content

Conversation

@FilipBolt
Copy link
Collaborator

Added code comments around stemmer for future reference.

Have lemmatizer locally, but need to figure out how to handle resource files (in general in this project).

Also added markdown notes on project guidelines about coding standard.

Output of tests:

> py.test --cov=takepod test

========================================== test session starts
==========================================
platform linux -- Python 3.6.5, pytest-3.7.4, py-1.6.0, pluggy-0.7.1
rootdir: /home/filip/Documents/Doktorski/Projects/Podium, inifile:
plugins: cov-2.6.0
collected 4 items

test/test_base_model.py
.                                                                         [ 25%]
test/test_metrics.py
.                                                                            [ 50%]
test/test_preproc.py
.                                                                            [ 75%]
test/test_pytest.py
.                                                                             [100%]

----------- coverage: platform linux, python 3.6.5-final-0 -----------
Name                                                Stmts   Miss  Cover
-----------------------------------------------------------------------
takepod/__init__.py                                     1      0   100%
takepod/metrics/__init__.py                             3      0   100%
takepod/models/__init__.py                              0      0   100%
takepod/models/base/__init__.py                         0      0   100%
takepod/models/base_model.py                           11      3    73%
takepod/models/simple_sentiment_analysis.py            66     66     0%
takepod/preproc/__init__.py                             0      0   100%
takepod/preproc/lemmatizer/__init__.py                  0      0   100%
takepod/preproc/lemmatizer/croatian_lemmatizer.py      67     67     0%
takepod/preproc/stemmer/__init__.py                     0      0   100%
takepod/preproc/stemmer/croatian_stemmer.py            36     12    67%
takepod/storage/__init__.py                             0      0   100%
-----------------------------------------------------------------------
TOTAL                                                 184    148    20%


======================================= 4 passed in 0.84 seconds
========================================

Copy link
Member

@mttk mttk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, this is pretty simple for a stemmer. IMO we can also export the stopwords to a file (since the rules as well as the trasnforms are in a file), translate and comment everything and it's ok.

requirements.txt Outdated
@@ -1,26 +1,58 @@
atomicwrites==1.2.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all of the requirements actually required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I've trimmed down the list (roughly manually) and found that https://medium.com/@tomagee/pip-freeze-requirements-txt-considered-harmful-f0bce66cf895

I'll put the link in the README.md.

@FilipBolt
Copy link
Collaborator Author

Hope to have taken into account your comments. I rewrote the most of the stemmer and added tests to familiarize myself with it. The requirements file should also be cleaner, thanks for all the useful suggestions.

py.test --cov-report term-missing --cov=takepod test                                                   ========================================== test session starts ==========================================
platform linux -- Python 3.6.5, pytest-3.7.4, py-1.6.0, pluggy-0.7.1
rootdir: /home/filip/Documents/Doktorski/Projects/Podium, inifile:
plugins: cov-2.6.0
collected 8 items

test/test_base_model.py .                                                                         [ 12%]
test/test_metrics.py .                                                                            [ 25%]
test/test_preproc.py .....                                                                        [ 87%]
test/test_pytest.py .                                                                             [100%]

----------- coverage: platform linux, python 3.6.5-final-0 -----------
Name                                                Stmts   Miss  Cover   Missing
---------------------------------------------------------------------------------
takepod/__init__.py                                     1      0   100%
takepod/metrics/__init__.py                             3      0   100%
takepod/models/__init__.py                              0      0   100%
takepod/models/base/__init__.py                         0      0   100%
takepod/models/base_model.py                           11      3    73%   8, 15, 19
takepod/preproc/__init__.py                             0      0   100%
takepod/preproc/lemmatizer/__init__.py                  0      0   100%
takepod/preproc/lemmatizer/croatian_lemmatizer.py      67     67     0%   1-119
takepod/preproc/stemmer/__init__.py                     0      0   100%
takepod/preproc/stemmer/croatian_stemmer.py            35      0   100%
takepod/storage/__init__.py                             0      0   100%
---------------------------------------------------------------------------------
TOTAL                                                 117     70    40%


======================================= 8 passed in 0.89 seconds ========================================

@FilipBolt FilipBolt merged commit 522bcf3 into master Sep 14, 2018
@FilipBolt FilipBolt deleted the stemmer branch September 14, 2018 08:17
ivansmokovic added a commit that referenced this pull request Feb 22, 2019
mariosasko added a commit that referenced this pull request Apr 1, 2021
mariosasko added a commit that referenced this pull request Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants