Hello community,

here is the log from the commit of package python-padatious for 
openSUSE:Factory checked in at 2018-08-27 13:00:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-padatious (Old)
 and      /work/SRC/openSUSE:Factory/.python-padatious.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-padatious"

Mon Aug 27 13:00:00 2018 rev:4 rq:631621 version:0.4.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-padatious/python-padatious.changes        
2018-08-15 10:37:43.352218153 +0200
+++ /work/SRC/openSUSE:Factory/.python-padatious.new/python-padatious.changes   
2018-08-27 13:00:02.104861087 +0200
@@ -1,0 +2,8 @@
+Sun Aug 26 17:43:03 UTC 2018 - [email protected]
+
+- Update to python-padatious 0.4.5
+  * Add test cases to assert proper selection between perfect matches
+  * Fix discriminating against multiple Padaos matches
+  * Fix implicit intent training
+
+-------------------------------------------------------------------

Old:
----
  padatious-0.4.4.tar.gz

New:
----
  padatious-0.4.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-padatious.spec ++++++
--- /var/tmp/diff_new_pack.DR5gm9/_old  2018-08-27 13:00:02.892861946 +0200
+++ /var/tmp/diff_new_pack.DR5gm9/_new  2018-08-27 13:00:02.892861946 +0200
@@ -20,7 +20,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-padatious
-Version:        0.4.4
+Version:        0.4.5
 Release:        0
 Summary:        A neural network intent parser
 License:        Apache-2.0

++++++ padatious-0.4.4.tar.gz -> padatious-0.4.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padatious-0.4.4/PKG-INFO new/padatious-0.4.5/PKG-INFO
--- old/padatious-0.4.4/PKG-INFO        2018-07-31 22:27:47.000000000 +0200
+++ new/padatious-0.4.5/PKG-INFO        2018-08-13 23:03:15.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: padatious
-Version: 0.4.4
+Version: 0.4.5
 Summary: A neural network intent parser
 Home-page: http://github.com/MycroftAI/padatious
 Author: Matthew Scholefield
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padatious-0.4.4/padatious/__init__.py 
new/padatious-0.4.5/padatious/__init__.py
--- old/padatious-0.4.4/padatious/__init__.py   2018-07-31 22:27:27.000000000 
+0200
+++ new/padatious-0.4.5/padatious/__init__.py   2018-08-13 23:02:12.000000000 
+0200
@@ -15,4 +15,4 @@
 from .intent_container import IntentContainer
 from .match_data import MatchData
 
-__version__ = '0.4.4'  # Also change in setup.py
+__version__ = '0.4.5'  # Also change in setup.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padatious-0.4.4/padatious/intent_container.py 
new/padatious-0.4.5/padatious/intent_container.py
--- old/padatious-0.4.4/padatious/intent_container.py   2018-07-31 
22:26:48.000000000 +0200
+++ new/padatious-0.4.5/padatious/intent_container.py   2018-08-13 
22:56:59.000000000 +0200
@@ -27,6 +27,7 @@
         cache_dir (str): Place to put all saved neural networks
     """
     def __init__(self, cache_dir):
+        self.must_train = False
         self.intents = IntentManager(cache_dir)
         self.entities = EntityManager(cache_dir)
         self.padaos = padaos.IntentContainer()
@@ -42,6 +43,7 @@
         """
         self.intents.add(name, lines, reload_cache)
         self.padaos.add_intent(name, lines)
+        self.must_train = True
 
     def add_entity(self, name, lines, reload_cache=False):
         """
@@ -59,6 +61,7 @@
         Entity.verify_name(name)
         self.entities.add(Entity.wrap_name(name), lines, reload_cache)
         self.padaos.add_entity(name, lines)
+        self.must_train = True
 
     def load_entity(self, name, file_name, reload_cache=False):
         """
@@ -95,6 +98,7 @@
         """Unload an intent"""
         self.intents.remove(name)
         self.padaos.remove_intent(name)
+        self.must_train = True
 
     def remove_entity(self, name):
         """Unload an entity"""
@@ -116,6 +120,7 @@
         self.entities.train(*args, **kwargs)
         self.entities.calc_ent_dict()
         self.padaos.compile()
+        self.must_train = False
 
     def calc_intents(self, query):
         """
@@ -128,6 +133,8 @@
             list<MatchData>: List of intent matches
         See calc_intent() for a description of the returned MatchData
         """
+        if self.must_train:
+            self.train()
         intents = {
             i.name: i for i in self.intents.calc_intents(query, self.entities)
         }
@@ -151,4 +158,6 @@
         matches = self.calc_intents(query)
         if len(matches) == 0:
             return MatchData('', '')
-        return max(matches, key=lambda x: x.conf)
+        best_match = max(matches, key=lambda x: x.conf)
+        best_matches = (match for match in matches if match.conf == 
best_match.conf)
+        return min(best_matches, key=lambda x: sum(map(len, 
x.matches.values())))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padatious-0.4.4/padatious.egg-info/PKG-INFO 
new/padatious-0.4.5/padatious.egg-info/PKG-INFO
--- old/padatious-0.4.4/padatious.egg-info/PKG-INFO     2018-07-31 
22:27:47.000000000 +0200
+++ new/padatious-0.4.5/padatious.egg-info/PKG-INFO     2018-08-13 
23:03:15.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: padatious
-Version: 0.4.4
+Version: 0.4.5
 Summary: A neural network intent parser
 Home-page: http://github.com/MycroftAI/padatious
 Author: Matthew Scholefield
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padatious-0.4.4/setup.py new/padatious-0.4.5/setup.py
--- old/padatious-0.4.4/setup.py        2018-07-31 22:27:21.000000000 +0200
+++ new/padatious-0.4.5/setup.py        2018-08-13 23:02:01.000000000 +0200
@@ -7,7 +7,7 @@
 
 setup(
     name='padatious',
-    version='0.4.4',  # Also change in padatious/__init__.py
+    version='0.4.5',  # Also change in padatious/__init__.py
     description='A neural network intent parser',
     url='http://github.com/MycroftAI/padatious',
     author='Matthew Scholefield',


Reply via email to