diff --git a/nlp_profiler/core.py b/nlp_profiler/core.py index a5d2b08..34cd0c4 100644 --- a/nlp_profiler/core.py +++ b/nlp_profiler/core.py @@ -22,10 +22,12 @@ PARALLELISATION_METHOD_OPTION, DEFAULT_PARALLEL_METHOD, GRANULAR_OPTION, HIGH_LEVEL_OPTION, \ GRAMMAR_CHECK_OPTION, SPELLING_CHECK_OPTION from nlp_profiler.generate_features import get_progress_bar -from nlp_profiler.grammar_quality_check import apply_grammar_check from nlp_profiler.granular_features import apply_granular_features from nlp_profiler.high_level_features import apply_high_level_features -from nlp_profiler.spelling_quality_check import apply_spelling_check +from nlp_profiler.high_level_features.grammar_quality_check \ + import apply_grammar_check +from nlp_profiler.high_level_features.spelling_quality_check \ + import apply_spelling_check def apply_text_profiling(dataframe: pd.DataFrame, diff --git a/nlp_profiler/high_level_features.py b/nlp_profiler/high_level_features/__init__.py similarity index 92% rename from nlp_profiler/high_level_features.py rename to nlp_profiler/high_level_features/__init__.py index ab0e085..62d05a7 100644 --- a/nlp_profiler/high_level_features.py +++ b/nlp_profiler/high_level_features/__init__.py @@ -7,10 +7,10 @@ from nlp_profiler.constants import \ SENTIMENT_SUBJECTIVITY_COL, SENTIMENT_SUBJECTIVITY_SCORE_COL, SENTIMENT_SUBJECTIVITY_SUMMARISED_COL from nlp_profiler.generate_features import generate_features -from nlp_profiler.sentiment_polarity \ +from nlp_profiler.high_level_features.sentiment_polarity \ import sentiment_polarity_score, sentiment_polarity, \ sentiment_polarity_summarised -from nlp_profiler.sentiment_subjectivity \ +from nlp_profiler.high_level_features.sentiment_subjectivity \ import sentiment_subjectivity_score, \ sentiment_subjectivity_summarised, sentiment_subjectivity diff --git a/nlp_profiler/grammar_quality_check.py b/nlp_profiler/high_level_features/grammar_quality_check.py similarity index 100% rename from nlp_profiler/grammar_quality_check.py rename to nlp_profiler/high_level_features/grammar_quality_check.py diff --git a/nlp_profiler/sentiment_polarity.py b/nlp_profiler/high_level_features/sentiment_polarity.py similarity index 100% rename from nlp_profiler/sentiment_polarity.py rename to nlp_profiler/high_level_features/sentiment_polarity.py diff --git a/nlp_profiler/sentiment_subjectivity.py b/nlp_profiler/high_level_features/sentiment_subjectivity.py similarity index 100% rename from nlp_profiler/sentiment_subjectivity.py rename to nlp_profiler/high_level_features/sentiment_subjectivity.py diff --git a/nlp_profiler/spelling_quality_check.py b/nlp_profiler/high_level_features/spelling_quality_check.py similarity index 100% rename from nlp_profiler/spelling_quality_check.py rename to nlp_profiler/high_level_features/spelling_quality_check.py diff --git a/notebooks/google-colab/nlp_profiler-granular.ipynb b/notebooks/google-colab/nlp_profiler-granular.ipynb index d54cf02..f1c6a36 100644 --- a/notebooks/google-colab/nlp_profiler-granular.ipynb +++ b/notebooks/google-colab/nlp_profiler-granular.ipynb @@ -673,17 +673,17 @@ } ], "source": [ - "from nlp_profiler.emojis import gather_emojis, count_emojis\n", - "from nlp_profiler.numbers import gather_whole_numbers, count_whole_numbers\n", - "from nlp_profiler.alphanumeric import gather_alpha_numeric, count_alpha_numeric\n", - "from nlp_profiler.non_alphanumeric import gather_non_alpha_numeric, count_non_alpha_numeric\n", - "from nlp_profiler.punctuations import gather_punctuations, count_punctuations\n", - "from nlp_profiler.stop_words import gather_stop_words, count_stop_words\n", - "from nlp_profiler.dates import gather_dates, count_dates\n", - "from nlp_profiler.words import gather_words, count_words\n", - "from nlp_profiler.duplicates import gather_duplicates, count_duplicates\n", - "from nlp_profiler.sentences import gather_sentences, count_sentences\n", - "from nlp_profiler.chars_and_spaces import count_chars, count_spaces, count_characters_excluding_spaces" + "from nlp_profiler.granular_features.emojis import gather_emojis, count_emojis\n", + "from nlp_profiler.granular_features.numbers import gather_whole_numbers, count_whole_numbers\n", + "from nlp_profiler.granular_features.alphanumeric import gather_alpha_numeric, count_alpha_numeric\n", + "from nlp_profiler.granular_features.non_alphanumeric import gather_non_alpha_numeric, count_non_alpha_numeric\n", + "from nlp_profiler.granular_features.punctuations import gather_punctuations, count_punctuations\n", + "from nlp_profiler.granular_features.stop_words import gather_stop_words, count_stop_words\n", + "from nlp_profiler.granular_features.dates import gather_dates, count_dates\n", + "from nlp_profiler.granular_features.words import gather_words, count_words\n", + "from nlp_profiler.granular_features.duplicates import gather_duplicates, count_duplicates\n", + "from nlp_profiler.granular_features.sentences import gather_sentences, count_sentences\n", + "from nlp_profiler.granular_features.chars_and_spaces import count_chars, count_spaces, count_characters_excluding_spaces" ] }, { diff --git a/notebooks/jupyter/nlp_profiler-granular.ipynb b/notebooks/jupyter/nlp_profiler-granular.ipynb index bb308be..928f5fd 100644 --- a/notebooks/jupyter/nlp_profiler-granular.ipynb +++ b/notebooks/jupyter/nlp_profiler-granular.ipynb @@ -636,7 +636,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -648,13 +648,15 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ + "/anaconda3/lib/python3.7/site-packages/dask/dataframe/utils.py:14: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.\n", + " import pandas.util.testing as tm\n", "[nltk_data] Downloading package stopwords to /Users/swami/nltk_data...\n", "[nltk_data] Package stopwords is already up-to-date!\n", "[nltk_data] Downloading package punkt to /Users/swami/nltk_data...\n", @@ -663,17 +665,17 @@ } ], "source": [ - "from nlp_profiler.emojis import gather_emojis, count_emojis\n", - "from nlp_profiler.numbers import gather_whole_numbers, count_whole_numbers\n", - "from nlp_profiler.alphanumeric import gather_alpha_numeric, count_alpha_numeric\n", - "from nlp_profiler.non_alphanumeric import gather_non_alpha_numeric, count_non_alpha_numeric\n", - "from nlp_profiler.punctuations import gather_punctuations, count_punctuations\n", - "from nlp_profiler.stop_words import gather_stop_words, count_stop_words\n", - "from nlp_profiler.dates import gather_dates, count_dates\n", - "from nlp_profiler.words import gather_words, count_words\n", - "from nlp_profiler.duplicates import gather_duplicates, count_duplicates\n", - "from nlp_profiler.sentences import gather_sentences, count_sentences\n", - "from nlp_profiler.chars_and_spaces import count_chars, count_spaces, count_characters_excluding_spaces" + "from nlp_profiler.granular_features.emojis import gather_emojis, count_emojis\n", + "from nlp_profiler.granular_features.numbers import gather_whole_numbers, count_whole_numbers\n", + "from nlp_profiler.granular_features.alphanumeric import gather_alpha_numeric, count_alpha_numeric\n", + "from nlp_profiler.granular_features.non_alphanumeric import gather_non_alpha_numeric, count_non_alpha_numeric\n", + "from nlp_profiler.granular_features.punctuations import gather_punctuations, count_punctuations\n", + "from nlp_profiler.granular_features.stop_words import gather_stop_words, count_stop_words\n", + "from nlp_profiler.granular_features.dates import gather_dates, count_dates\n", + "from nlp_profiler.granular_features.words import gather_words, count_words\n", + "from nlp_profiler.granular_features.duplicates import gather_duplicates, count_duplicates\n", + "from nlp_profiler.granular_features.sentences import gather_sentences, count_sentences\n", + "from nlp_profiler.granular_features.chars_and_spaces import count_chars, count_spaces, count_characters_excluding_spaces" ] }, { @@ -685,7 +687,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -694,7 +696,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -703,7 +705,7 @@ "['soccer_ball', 'beaming_face_with_smiling_eyes']" ] }, - "execution_count": 5, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -714,7 +716,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -723,7 +725,7 @@ "2" ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -741,7 +743,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -750,7 +752,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -759,7 +761,7 @@ "['2833047']" ] }, - "execution_count": 8, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -770,7 +772,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -779,7 +781,7 @@ "1" ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -790,7 +792,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -799,7 +801,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -808,7 +810,7 @@ "['2833047', '1111']" ] }, - "execution_count": 11, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -819,7 +821,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -828,7 +830,7 @@ "2" ] }, - "execution_count": 12, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -846,7 +848,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -881,7 +883,7 @@ " 'a']" ] }, - "execution_count": 13, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -892,7 +894,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -901,7 +903,7 @@ "27" ] }, - "execution_count": 14, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -919,7 +921,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -928,7 +930,7 @@ "[' ', ' ', ' ', ' ', ' ']" ] }, - "execution_count": 15, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -939,7 +941,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -948,7 +950,7 @@ "[' ', ' ', '⚽', ' ', ' ', ' ', '😁']" ] }, - "execution_count": 16, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -959,7 +961,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -968,7 +970,7 @@ "5" ] }, - "execution_count": 17, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -979,7 +981,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -988,7 +990,7 @@ "7" ] }, - "execution_count": 18, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -1006,7 +1008,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -1015,7 +1017,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -1024,7 +1026,7 @@ "[\"'\", ',', '-', '(', ';', ')', '.']" ] }, - "execution_count": 20, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -1035,7 +1037,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -1044,7 +1046,7 @@ "7" ] }, - "execution_count": 21, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -1062,7 +1064,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -1071,7 +1073,7 @@ "['in', 'this']" ] }, - "execution_count": 22, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -1082,7 +1084,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -1091,7 +1093,7 @@ "2" ] }, - "execution_count": 23, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -1109,7 +1111,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -1118,7 +1120,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -1127,7 +1129,7 @@ "[('28', '04', '2020')]" ] }, - "execution_count": 25, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -1138,7 +1140,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -1147,7 +1149,7 @@ "[('04', '28', '2020')]" ] }, - "execution_count": 26, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -1158,7 +1160,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -1167,7 +1169,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -1176,7 +1178,7 @@ "[('28', '04', '2020'), ('29', '04', '2020')]" ] }, - "execution_count": 28, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -1187,7 +1189,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -1196,7 +1198,7 @@ "2" ] }, - "execution_count": 29, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -1214,7 +1216,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -1223,7 +1225,7 @@ "['people', 'live', 'in', 'this', 'area']" ] }, - "execution_count": 30, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -1234,7 +1236,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -1243,7 +1245,7 @@ "5" ] }, - "execution_count": 31, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" } @@ -1261,7 +1263,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 31, "metadata": {}, "outputs": [ { @@ -1270,7 +1272,7 @@ "['I love ⚽ very much 😁']" ] }, - "execution_count": 45, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -1281,7 +1283,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -1290,7 +1292,7 @@ "1" ] }, - "execution_count": 46, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -1301,7 +1303,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -1310,7 +1312,7 @@ "['2833047 people live in this area']" ] }, - "execution_count": 32, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -1321,7 +1323,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -1330,7 +1332,7 @@ "1" ] }, - "execution_count": 33, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -1341,7 +1343,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -1350,7 +1352,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -1359,7 +1361,7 @@ "['2833047 people live in this area.', 'I love ⚽ very much 😁']" ] }, - "execution_count": 38, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -1370,7 +1372,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -1379,7 +1381,7 @@ "2" ] }, - "execution_count": 39, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -1397,7 +1399,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -1406,7 +1408,7 @@ "32" ] }, - "execution_count": 40, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -1424,7 +1426,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -1433,7 +1435,7 @@ "5" ] }, - "execution_count": 41, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -1444,7 +1446,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -1453,7 +1455,7 @@ "27" ] }, - "execution_count": 42, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -1471,7 +1473,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 41, "metadata": {}, "outputs": [ { @@ -1480,7 +1482,7 @@ "{}" ] }, - "execution_count": 43, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -1491,7 +1493,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 42, "metadata": {}, "outputs": [], "source": [ @@ -1500,7 +1502,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -1516,7 +1518,7 @@ "3" ] }, - "execution_count": 42, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } diff --git a/slow-tests/performance_tests/test_perf_grammar_check.py b/slow-tests/performance_tests/test_perf_grammar_check.py index eaec0a9..b9f657f 100644 --- a/slow-tests/performance_tests/test_perf_grammar_check.py +++ b/slow-tests/performance_tests/test_perf_grammar_check.py @@ -6,7 +6,8 @@ import git sys.path.insert(0, '../../performance-tests/high_level') -from nlp_profiler.grammar_quality_check import grammar_check_score +from nlp_profiler.high_level_features.grammar_quality_check \ + import grammar_check_score from line_profiler import LineProfiler CURRENT_SOURCE_FILEPATH = os.path.abspath(__file__) @@ -68,6 +69,6 @@ def generate_data() -> list: text_with_punctuations, text_with_a_date, text_with_dates, text_with_duplicates] new_data = [] - for index in range(1): + for _ in range(1): new_data.extend(data) return new_data diff --git a/slow-tests/performance_tests/test_perf_spelling_check.py b/slow-tests/performance_tests/test_perf_spelling_check.py index e44809c..5be9bcb 100644 --- a/slow-tests/performance_tests/test_perf_spelling_check.py +++ b/slow-tests/performance_tests/test_perf_spelling_check.py @@ -1,12 +1,14 @@ import os import sys +from contextlib import redirect_stdout from datetime import datetime from time import time -from contextlib import redirect_stdout + import git sys.path.insert(0, '../../performance-tests/high_level') -from nlp_profiler.spelling_quality_check import spelling_quality_score +from nlp_profiler.high_level_features.spelling_quality_check \ + import spelling_quality_score from line_profiler import LineProfiler CURRENT_SOURCE_FILEPATH = os.path.abspath(__file__) @@ -68,6 +70,6 @@ def generate_data() -> list: text_with_punctuations, text_with_a_date, text_with_dates, text_with_duplicates] new_data = [] - for index in range(1): + for _ in range(1): new_data.extend(data) return new_data diff --git a/tests/high_level/test_grammar_check.py b/tests/high_level/test_grammar_check.py index 274e9cd..66d6ed6 100644 --- a/tests/high_level/test_grammar_check.py +++ b/tests/high_level/test_grammar_check.py @@ -2,7 +2,7 @@ import pytest from nlp_profiler.constants import NaN, NOT_APPLICABLE -from nlp_profiler.grammar_quality_check \ +from nlp_profiler.high_level_features.grammar_quality_check \ import grammar_check_score, grammar_quality # noqa grammar_issues_text = 'Everyone here is so hardworking. Hardworking people. ' \ diff --git a/tests/high_level/test_sentiment_polarity.py b/tests/high_level/test_sentiment_polarity.py index 2da62fd..ed5a12a 100644 --- a/tests/high_level/test_sentiment_polarity.py +++ b/tests/high_level/test_sentiment_polarity.py @@ -4,8 +4,8 @@ import pytest from nlp_profiler.constants import NOT_APPLICABLE, NaN -from nlp_profiler.sentiment_polarity import sentiment_polarity_score, \ - sentiment_polarity_summarised, sentiment_polarity # noqa +from nlp_profiler.high_level_features.sentiment_polarity \ + import sentiment_polarity_score, sentiment_polarity_summarised, sentiment_polarity # noqa positive_text = "This sentence doesn't seem to too many commas, periods or semi-colons (;)." negative_text = "2833047 people live in this area. It is not a good area." diff --git a/tests/high_level/test_sentiment_subjectivity.py b/tests/high_level/test_sentiment_subjectivity.py index 9e903ff..7062d53 100644 --- a/tests/high_level/test_sentiment_subjectivity.py +++ b/tests/high_level/test_sentiment_subjectivity.py @@ -4,8 +4,8 @@ import pytest from nlp_profiler.constants import NOT_APPLICABLE, NaN -from nlp_profiler.sentiment_subjectivity import sentiment_subjectivity_score, \ - sentiment_subjectivity_summarised, sentiment_subjectivity # noqa +from nlp_profiler.high_level_features.sentiment_subjectivity \ + import sentiment_subjectivity_score, sentiment_subjectivity_summarised, sentiment_subjectivity # noqa objective_subjective_text = '2833047 and 1111 people live in this area.' objective_text = "Today's date is 04/28/2020 for format mm/dd/yyyy, not 28/04/2020." diff --git a/tests/high_level/test_spelling_check.py b/tests/high_level/test_spelling_check.py index eefac61..ac595e3 100644 --- a/tests/high_level/test_spelling_check.py +++ b/tests/high_level/test_spelling_check.py @@ -4,8 +4,8 @@ import pytest from nlp_profiler.constants import NOT_APPLICABLE, NaN -from nlp_profiler.spelling_quality_check import spelling_quality_score, \ - spelling_quality, spelling_quality_summarised # noqa +from nlp_profiler.high_level_features.spelling_quality_check \ + import spelling_quality_score, spelling_quality, spelling_quality_summarised # noqa very_good_spelling_text = 'People live in this area. It is not a good area. People live in this area. It is not a good area. 2833047 people live in this area. It is not a good area.' quite_good_spelling_text = 'People live in this area. It is not a good area. People live in this area. It is not a good area. 2833047 people live in this area. It is not a good arae.'