Skip to content

Commit

Permalink
use woodwork typing for elmo primitive i/o
Browse files Browse the repository at this point in the history
  • Loading branch information
rwedge committed Sep 30, 2021
1 parent 2537a88 commit 755d10b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nlp_primitives/elmo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from featuretools.primitives.base import TransformPrimitive
from featuretools.variable_types import NaturalLanguage, Numeric
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double, NaturalLanguage


class Elmo(TransformPrimitive):
Expand All @@ -25,8 +26,8 @@ class Elmo(TransformPrimitive):
[-0.3457, -0.4546, 0.2538]
"""
name = "elmo"
input_types = [NaturalLanguage]
return_type = Numeric
input_types = [ColumnSchema(logical_type=NaturalLanguage)]
return_type = ColumnSchema(logical_type=Double, semantic_tags="numeric")

def __init__(self):
self.handle = "https://tfhub.dev/google/elmo/2"
Expand Down

0 comments on commit 755d10b

Please sign in to comment.