From 678517dd89c4ab745797dc7688c43b89d6c5ecbe Mon Sep 17 00:00:00 2001 From: Sergey Obukhov Date: Thu, 24 Aug 2017 12:01:09 -0700 Subject: [PATCH] reshape data as suggested by sklearn --- setup.py | 2 +- talon/signature/extraction.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 642b39e..29c2b98 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ class InstallCommand(install): setup(name='talon', - version='1.4.2', + version='1.4.3', description=("Mailgun library " "to extract message quotations and signatures."), long_description=open("README.rst").read(), diff --git a/talon/signature/extraction.py b/talon/signature/extraction.py index fb88b32..14e750a 100644 --- a/talon/signature/extraction.py +++ b/talon/signature/extraction.py @@ -32,7 +32,7 @@ RE_REVERSE_SIGNATURE = re.compile(r''' def is_signature_line(line, sender, classifier): '''Checks if the line belongs to signature. Returns True or False.''' - data = numpy.array(build_pattern(line, features(sender))) + data = numpy.array(build_pattern(line, features(sender))).reshape(1, -1) return classifier.predict(data) > 0