Skip to content

Commit

Permalink
Fix/unit tests (#59)
Browse files Browse the repository at this point in the history
* Tests and Sentment Analysis (#39)

* hotfix names

* Refactor: Format date (#27)

* refactor: capitalize sentiments (#24)

Co-authored-by: JoaoM-py <[email protected]>

* fix: translate sentiments (#28)

* Feat/separate training reviews (#35)

* feat: create function to get random data

* feat: create function to get training data

* feat: get training data

* chore: Manual sentiment classification

---------

Co-authored-by: Maria Gabriela Reis <[email protected]>

* Feat/#0303 create classification model (#37)

* feat: update manual classification

* fix: translate topics and sentiments

* feat: add seaborn lib

* fix: translate topics, update reviews count

* feat: create classification model

* feat: training, test and apply classification model

* refactor: Update stars name

* refactor: Update training method

---------

Co-authored-by: JoaoM-py <[email protected]>

* Feat/#42 test coverage (#38)

* feat: create pipeline tests

* refactor: Update files names

* feat: Training data

* feat: Creating pipeline tests

* merge: Merge develop

* feat: Coverage and sonarcloud config

* refactor: Update processing and remove comments

* chore: update python version

* chore: update sonarcloud

* chore: update tests

* chore: update tests

* chore: update tests

---------

Co-authored-by: GabrielCamargoL <[email protected]>
Co-authored-by: JoaoM-py <[email protected]>
Co-authored-by: JoaoM-py <[email protected]>

* feat: add new model to sentiment analysis

* fix: use correct training and treat exceptions

* fix: remove console logs

* feat: increment reviews quantity

* fix: tests of the updated pipeline

* feat: select only necessary columns and apply your types

* feat: optimize clear data step

* Delete .env

* style: format and remove unused files

* feat: create a file for pre processing step

* feat: create file to classification model

* feat: create file to topic model

* feat: get metrics from classification model

* feat: use new steps and adjust details

* fix: remove some code smells and run processing

* fix: update training and test data visualization

* feat: create and fix unit tests

* fix: remove .coverage

* reafacto: remove unused test

---------

Co-authored-by: Maria Gabriela Reis <[email protected]>
Co-authored-by: GabrielCamargoL <[email protected]>
  • Loading branch information
3 people authored Nov 30, 2023
1 parent ad1f1ed commit 80a79b6
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 225 deletions.
235 changes: 93 additions & 142 deletions coverage.xml
Original file line number Diff line number Diff line change
@@ -1,116 +1,107 @@
<?xml version="1.0" ?>
<coverage version="7.3.2" timestamp="1699227590016" lines-valid="286" lines-covered="274" line-rate="0.958" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<coverage version="7.3.2" timestamp="1701097543365" lines-valid="243" lines-covered="233" line-rate="0.9588" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.3.2 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
<source>C:\Users\joaom\Área de Trabalho\Mood-hound\mood-hound-nlp</source>
</sources>
<packages>
<package name="pipeline" line-rate="0.9875" branch-rate="0" complexity="0">
<package name="pipeline" line-rate="0.9718" branch-rate="0" complexity="0">
<classes>
<class name="access_data.py" filename="pipeline/access_data.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="4" hits="1"/>
<line number="6" hits="1"/>
<line number="1" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="10" hits="1"/>
<line number="18" hits="1"/>
<line number="20" hits="1"/>
<line number="21" hits="1"/>
<line number="30" hits="1"/>
</lines>
</class>
<class name="clear_data.py" filename="pipeline/clear_data.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="1" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="12" hits="1"/>
<line number="13" hits="1"/>
<line number="14" hits="1"/>
<line number="15" hits="1"/>
<line number="16" hits="1"/>
<line number="18" hits="1"/>
<line number="26" hits="1"/>
<line number="27" hits="1"/>
<line number="28" hits="1"/>
<line number="29" hits="1"/>
<line number="30" hits="1"/>
<line number="32" hits="1"/>
<line number="33" hits="1"/>
<line number="35" hits="1"/>
<line number="36" hits="1"/>
<line number="38" hits="1"/>
<line number="43" hits="1"/>
<line number="44" hits="1"/>
<line number="45" hits="1"/>
<line number="47" hits="1"/>
</lines>
</class>
<class name="processing.py" filename="pipeline/processing.py" complexity="0" line-rate="1" branch-rate="0">
<class name="pre_processing.py" filename="pipeline/pre_processing.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="1" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="12" hits="1"/>
<line number="13" hits="1"/>
<line number="14" hits="1"/>
<line number="15" hits="1"/>
<line number="17" hits="1"/>
<line number="16" hits="1"/>
<line number="18" hits="1"/>
<line number="19" hits="1"/>
<line number="20" hits="1"/>
<line number="23" hits="1"/>
<line number="24" hits="1"/>
<line number="27" hits="1"/>
<line number="28" hits="1"/>
<line number="31" hits="1"/>
<line number="32" hits="1"/>
<line number="34" hits="1"/>
<line number="35" hits="1"/>
<line number="36" hits="1"/>
<line number="37" hits="1"/>
<line number="38" hits="1"/>
<line number="40" hits="1"/>
<line number="41" hits="1"/>
<line number="42" hits="1"/>
<line number="43" hits="1"/>
<line number="44" hits="1"/>
<line number="47" hits="1"/>
<line number="48" hits="1"/>
<line number="49" hits="1"/>
<line number="51" hits="1"/>
<line number="64" hits="1"/>
<line number="65" hits="1"/>
<line number="67" hits="1"/>
</lines>
</class>
<class name="storage.py" filename="pipeline/storage.py" complexity="0" line-rate="0.9524" branch-rate="0">
<class name="storage.py" filename="pipeline/storage.py" complexity="0" line-rate="0.9412" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="7" hits="1"/>
<line number="6" hits="1"/>
<line number="9" hits="1"/>
<line number="11" hits="1"/>
<line number="12" hits="0"/>
<line number="15" hits="1"/>
<line number="17" hits="1"/>
<line number="21" hits="1"/>
<line number="23" hits="1"/>
<line number="24" hits="1"/>
<line number="22" hits="1"/>
<line number="25" hits="1"/>
<line number="26" hits="1"/>
<line number="28" hits="1"/>
<line number="29" hits="1"/>
<line number="30" hits="1"/>
<line number="31" hits="1"/>
<line number="34" hits="1"/>
<line number="36" hits="1"/>
<line number="38" hits="1"/>
<line number="32" hits="1"/>
<line number="33" hits="1"/>
<line number="35" hits="1"/>
<line number="39" hits="1"/>
<line number="42" hits="1"/>
<line number="43" hits="1"/>
<line number="45" hits="1"/>
<line number="46" hits="1"/>
<line number="47" hits="1"/>
<line number="48" hits="1"/>
<line number="50" hits="1"/>
<line number="54" hits="0"/>
<line number="57" hits="1"/>
<line number="58" hits="1"/>
<line number="59" hits="1"/>
<line number="60" hits="1"/>
<line number="63" hits="1"/>
</lines>
</class>
</classes>
</package>
<package name="tests" line-rate="0.9384" branch-rate="0" complexity="0">
<package name="tests" line-rate="0.9389" branch-rate="0" complexity="0">
<classes>
<class name="test_access_data.py" filename="tests/test_access_data.py" complexity="0" line-rate="0.8125" branch-rate="0">
<methods/>
Expand All @@ -133,28 +124,24 @@
<line number="22" hits="0"/>
</lines>
</class>
<class name="test_calculate_time.py" filename="tests/test_calculate_time.py" complexity="0" line-rate="0.9375" branch-rate="0">
<class name="test_calculate_time.py" filename="tests/test_calculate_time.py" complexity="0" line-rate="0.9167" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="12" hits="1"/>
<line number="13" hits="1"/>
<line number="14" hits="1"/>
<line number="15" hits="1"/>
<line number="16" hits="1"/>
<line number="17" hits="1"/>
<line number="18" hits="1"/>
<line number="20" hits="1"/>
<line number="21" hits="0"/>
<line number="17" hits="0"/>
</lines>
</class>
<class name="test_clear_data.py" filename="tests/test_clear_data.py" complexity="0" line-rate="0.9524" branch-rate="0">
<class name="test_clear_data.py" filename="tests/test_clear_data.py" complexity="0" line-rate="0.9545" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
Expand All @@ -176,8 +163,9 @@
<line number="42" hits="1"/>
<line number="43" hits="1"/>
<line number="44" hits="1"/>
<line number="47" hits="1"/>
<line number="48" hits="0"/>
<line number="45" hits="1"/>
<line number="48" hits="1"/>
<line number="49" hits="0"/>
</lines>
</class>
<class name="test_format_comments.py" filename="tests/test_format_comments.py" complexity="0" line-rate="0.9722" branch-rate="0">
Expand Down Expand Up @@ -221,30 +209,7 @@
<line number="45" hits="0"/>
</lines>
</class>
<class name="test_processing.py" filename="tests/test_processing.py" complexity="0" line-rate="0.9444" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="10" hits="1"/>
<line number="12" hits="1"/>
<line number="13" hits="1"/>
<line number="14" hits="1"/>
<line number="30" hits="1"/>
<line number="31" hits="1"/>
<line number="32" hits="1"/>
<line number="34" hits="1"/>
<line number="36" hits="1"/>
<line number="40" hits="1"/>
<line number="42" hits="1"/>
<line number="43" hits="0"/>
</lines>
</class>
<class name="test_show_topics.py" filename="tests/test_show_topics.py" complexity="0" line-rate="0.9474" branch-rate="0">
<class name="test_pre_processing.py" filename="tests/test_pre_processing.py" complexity="0" line-rate="0.9444" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
Expand All @@ -254,21 +219,24 @@
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="9" hits="1"/>
<line number="11" hits="1"/>
<line number="12" hits="1"/>
<line number="13" hits="1"/>
<line number="15" hits="1"/>
<line number="14" hits="1"/>
<line number="16" hits="1"/>
<line number="18" hits="1"/>
<line number="19" hits="1"/>
<line number="20" hits="1"/>
<line number="21" hits="1"/>
<line number="22" hits="1"/>
<line number="23" hits="1"/>
<line number="25" hits="1"/>
<line number="26" hits="0"/>
<line number="24" hits="1"/>
<line number="27" hits="1"/>
<line number="28" hits="0"/>
</lines>
</class>
<class name="test_storage_data.py" filename="tests/test_storage_data.py" complexity="0" line-rate="0.95" branch-rate="0">
<class name="test_processing.py" filename="tests/test_processing.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines/>
</class>
<class name="test_storage_data.py" filename="tests/test_storage_data.py" complexity="0" line-rate="0.963" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
Expand All @@ -285,30 +253,37 @@
<line number="24" hits="1"/>
<line number="25" hits="1"/>
<line number="27" hits="1"/>
<line number="29" hits="1"/>
<line number="30" hits="1"/>
<line number="31" hits="1"/>
<line number="32" hits="1"/>
<line number="33" hits="1"/>
<line number="34" hits="1"/>
<line number="35" hits="0"/>
<line number="36" hits="1"/>
<line number="37" hits="1"/>
<line number="42" hits="1"/>
<line number="44" hits="1"/>
<line number="48" hits="1"/>
<line number="49" hits="1"/>
<line number="52" hits="1"/>
<line number="58" hits="1"/>
<line number="59" hits="0"/>
</lines>
</class>
</classes>
</package>
<package name="utils" line-rate="0.9667" branch-rate="0" complexity="0">
<package name="utils" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="calculate_time.py" filename="utils/calculate_time.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="6" hits="1"/>
<line number="8" hits="1"/>
<line number="10" hits="1"/>
<line number="7" hits="1"/>
<line number="9" hits="1"/>
<line number="12" hits="1"/>
<line number="14" hits="1"/>
<line number="17" hits="1"/>
<line number="20" hits="1"/>
</lines>
</class>
<class name="format_comments.py" filename="utils/format_comments.py" complexity="0" line-rate="1" branch-rate="0">
Expand All @@ -318,58 +293,34 @@
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="13" hits="1"/>
<line number="14" hits="1"/>
<line number="16" hits="1"/>
<line number="15" hits="1"/>
<line number="17" hits="1"/>
<line number="18" hits="1"/>
<line number="19" hits="1"/>
<line number="21" hits="1"/>
<line number="23" hits="1"/>
<line number="20" hits="1"/>
<line number="22" hits="1"/>
<line number="24" hits="1"/>
<line number="25" hits="1"/>
<line number="26" hits="1"/>
<line number="28" hits="1"/>
<line number="29" hits="1"/>
<line number="30" hits="1"/>
<line number="31" hits="1"/>
<line number="33" hits="1"/>
<line number="36" hits="1"/>
<line number="34" hits="1"/>
<line number="35" hits="1"/>
<line number="37" hits="1"/>
<line number="38" hits="1"/>
<line number="39" hits="1"/>
<line number="40" hits="1"/>
<line number="41" hits="1"/>
<line number="42" hits="1"/>
<line number="43" hits="1"/>
<line number="45" hits="1"/>
<line number="44" hits="1"/>
<line number="46" hits="1"/>
<line number="47" hits="1"/>
<line number="48" hits="1"/>
<line number="50" hits="1"/>
</lines>
</class>
<class name="show_topics.py" filename="utils/show_topics.py" complexity="0" line-rate="0.8947" branch-rate="0">
<methods/>
<lines>
<line number="4" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="13" hits="1"/>
<line number="15" hits="1"/>
<line number="18" hits="1"/>
<line number="20" hits="1"/>
<line number="21" hits="1"/>
<line number="22" hits="1"/>
<line number="25" hits="1"/>
<line number="29" hits="1"/>
<line number="30" hits="0"/>
<line number="31" hits="0"/>
<line number="33" hits="1"/>
<line number="34" hits="1"/>
<line number="35" hits="1"/>
<line number="51" hits="1"/>
<line number="52" hits="1"/>
<line number="53" hits="1"/>
<line number="54" hits="1"/>
</lines>
</class>
</classes>
Expand Down
Loading

0 comments on commit 80a79b6

Please sign in to comment.