Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add primitives from nlp_primitives that do not require additional external libraries #2328

Merged
merged 5 commits into from Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/release_notes.rst
Expand Up @@ -7,6 +7,7 @@ Future Release
==============
* Enhancements
* Add ExponentialWeighted primitives and DateToTimeZone primitive (:pr:`2318`)
* Add 14 natural language primitives from ``nlp_primitives`` library (:pr:`2328`)
* Fixes
* Changes
* Documentation Changes
Expand All @@ -15,7 +16,7 @@ Future Release
* Testing Changes

Thanks to the following people for contributing to this release:
:user:`gsheni`, :user:`sbadithe`
:user:`gsheni`, :user:`sbadithe`, :user:`thehomebrewnerd`

v1.15.0 Oct 6, 2022
===================
Expand Down
1 change: 1 addition & 0 deletions featuretools/primitives/standard/api.py
Expand Up @@ -5,5 +5,6 @@
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 *
Copy link
Contributor

Choose a reason for hiding this comment

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

with the comment below you would just be able to do:
from featuretools.primitives.standard.natural_language_primitives import *

from featuretools.primitives.standard.rolling_transform_primitives import *
from featuretools.primitives.standard.transform_primitive import *
Empty file.
@@ -0,0 +1,43 @@
# 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,
)
Comment on lines +1 to +43
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

ex: https://github.com/alteryx/featuretools/pull/2187/files#diff-4ffbd94fdc40f8ee9f37abe2ead42e08aca5156d0b13c958a07573691929c9ce

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'll clean this up in the PR for issue #2179