Add primitives from nlp_primitives that do not require additional external libraries#2328
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2328 +/- ##
========================================
Coverage 99.38% 99.38%
========================================
Files 147 177 +30
Lines 17895 18773 +878
========================================
+ Hits 17785 18658 +873
- Misses 110 115 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
Should we put all these primitives in 1 file? |
@gsheni I fine with combining if you want to be consistent with how we have other primitives and tests organized. I just did it this way to start since that was the easiest way to move things over. What is your preference? EDIT: Combining into a single file goes against the proposal in Issue #2179 |
|
Gotcha |
| # flake8: noqa | ||
| from featuretools.primitives.standard.natural_language_primitives.count_string import ( | ||
| CountString, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.mean_characters_per_word import ( | ||
| MeanCharactersPerWord, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.median_word_length import ( | ||
| MedianWordLength, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.num_unique_separators import ( | ||
| NumUniqueSeparators, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.number_of_common_words import ( | ||
| NumberOfCommonWords, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.number_of_hashtags import ( | ||
| NumberOfHashtags, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.number_of_mentions import ( | ||
| NumberOfMentions, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.number_of_unique_words import ( | ||
| NumberOfUniqueWords, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.number_of_words_in_quotes import ( | ||
| NumberOfWordsInQuotes, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.punctuation_count import ( | ||
| PunctuationCount, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.title_word_count import ( | ||
| TitleWordCount, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.total_word_length import ( | ||
| TotalWordLength, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.upper_case_count import ( | ||
| UpperCaseCount, | ||
| ) | ||
| from featuretools.primitives.standard.natural_language_primitives.whitespace_count import ( | ||
| WhitespaceCount, | ||
| ) |
There was a problem hiding this comment.
A couple of minor things since we are going into the restructure directory route, to reduce the lines here we can just use relative imports, it's a bit cleaner. I would also move all of this code to __init__.py since we're trying to remove api.py as it's redundant to how init.py works.
There was a problem hiding this comment.
Yeah, I'll clean this up in the PR for issue #2179
| from featuretools.primitives.standard.datetime_transform_primitives import * | ||
| from featuretools.primitives.standard.exponential_transform_primitives import * | ||
| from featuretools.primitives.standard.latlong_transform_primitives import * | ||
| from featuretools.primitives.standard.natural_language_primitives.api import * |
There was a problem hiding this comment.
with the comment below you would just be able to do:
from featuretools.primitives.standard.natural_language_primitives import *
Add primitives from nlp_primitives that do not require additional external libraries
Closes #2287
Moves the following primitives from nlp_primitives to Featuretools: