Skip to content

Commit

Permalink
Merge pull request #1 from ahegel/float-embeddings
Browse files Browse the repository at this point in the history
Float embeddings
  • Loading branch information
ahegel authored Feb 5, 2021
2 parents d900971 + 1a75d4f commit 6ced2ed
Show file tree
Hide file tree
Showing 4 changed files with 1,941 additions and 1,261 deletions.
15 changes: 15 additions & 0 deletions pycrfsuite/_float_features.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from __future__ import print_function, absolute_import


class FloatFeatures(object):
def __init__(self, values):
if not isinstance(values, list):
raise ValueError("Values should be an instance of list()")
try:
self.values = [float(v) for v in values]
except ValueError:
print("All elements in values should be castable to type float.", file=sys.stderr)
raise
except:
print("Unexpected error:", sys.exc_info()[0])
raise
Loading

0 comments on commit 6ced2ed

Please sign in to comment.