Skip to content

Commit 05563df

Browse files
committed
Merge branch 'master' into 1.4.x-merge
2 parents e65ef79 + 5c6a6e9 commit 05563df

35 files changed

+1117
-323
lines changed

CHANGELOG.rst

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@ Rasa Change Log
77
All notable changes to this project will be documented in this file.
88
This project adheres to `Semantic Versioning`_ starting with version 1.0.
99

10+
11+
[Unreleased 1.5.0a1] - `master`_
12+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13+
14+
Added
15+
-----
16+
- Added data validator that checks if domain object returned is empty. If so, exit early from the command ``rasa data validate``
17+
- Added the KeywordIntentClassifier
18+
- Added documentation for ``AugmentedMemoizationPolicy``
19+
- Fall back to ``InMemoryTrackerStore`` in case there is any problem with the current
20+
tracker store
21+
22+
Changed
23+
-------
24+
- Do not retrain the entire Core model if only the ``templates`` section of the domain is changed.
25+
- Upgraded ``jsonschema`` version
26+
27+
Removed
28+
-------
29+
30+
Fixed
31+
-----
32+
- ``MultiProjectImporter`` now imports files in the order of the import statements
33+
- Fixed server hanging forever on leaving ``rasa shell`` before first message
34+
- Fixed rasa init showing traceback error when user does Keyboard Interrupt before choosing a project path
35+
- ``CountVectorsFeaturizer`` featurizes intents only if its analyzer is set to ``word``
36+
1037
[Unreleased 1.4.4]
1138
^^^^^^^^^^^^^^^^^^
1239

@@ -241,7 +268,6 @@ Changed
241268
-------
242269
- Pin gast to == 0.2.2
243270

244-
245271
[1.3.0] - 2019-09-05
246272
^^^^^^^^^^^^^^^^^^^^
247273

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ types:
4646
pytype --keep-going rasa
4747

4848
prepare-tests-macos: prepare-tests-files
49-
brew install graphviz
49+
brew install graphviz wget
5050

5151
prepare-tests-ubuntu: prepare-tests-files
5252
sudo apt-get -y install graphviz graphviz-dev python3-tk
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pipeline:
2+
- name: "KeywordIntentClassifier"

docs/core/knowledge-bases.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ The default mapping looks like:
358358
"8": lambda l: l[7],
359359
"9": lambda l: l[8],
360360
"10": lambda l: l[9],
361-
"ANY": lambda l: random.choice(list),
361+
"ANY": lambda l: random.choice(l),
362362
"LAST": lambda l: l[-1],
363363
}
364364
@@ -526,7 +526,7 @@ You can customize your ``InMemoryKnowledgeBase`` by overwriting the following fu
526526
"8": lambda l: l[7],
527527
"9": lambda l: l[8],
528528
"10": lambda l: l[9],
529-
"ANY": lambda l: random.choice(list),
529+
"ANY": lambda l: random.choice(l),
530530
"LAST": lambda l: l[-1],
531531
}
532532

docs/core/policies.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,24 @@ training data. It predicts the next action with confidence ``1.0``
417417
if this exact conversation exists in the training data, otherwise it
418418
predicts ``None`` with confidence ``0.0``.
419419

420+
Augmented Memoization Policy
421+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
422+
423+
The ``AugmentedMemoizationPolicy`` remembers examples from training
424+
stories for up to ``max_history`` turns, just like the ``MemoizationPolicy``.
425+
Additionally, it has a forgetting mechanism that will forget a certain amount
426+
of steps in the conversation history and try to find a match in your stories
427+
with the reduced history. It predicts the next action with confidence ``1.0``
428+
if a match is found, otherwise it predicts ``None`` with confidence ``0.0``.
429+
430+
.. note::
431+
432+
If you have dialogues where some slots that are set during
433+
prediction time might not be set in training stories (e.g. in training
434+
stories starting with a reminder not all previous slots are set),
435+
make sure to add the relevant stories without slots to your training
436+
data as well.
437+
420438
.. _fallback-policy:
421439

422440
Fallback Policy

docs/core/stories.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,6 @@ at a time):
176176
in the main stories, the first event can be an action or an utterance
177177
as well.
178178

179-
.. note::
180-
Unlike regular stories, checkpoints are not restricted to starting with an
181-
input from the user. As long as the checkpoint is inserted at the right points
182-
in the main stories, the first event can be an action or an utterance
183-
as well.
184-
185179

186180
OR Statements
187181
~~~~~~~~~~~~~

docs/nlu/components.rst

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -275,23 +275,8 @@ CountVectorsFeaturizer
275275
Intent Classifiers
276276
------------------
277277

278-
KeywordIntentClassifier
279-
~~~~~~~~~~~~~~~~~~~~~~~
280278

281-
:Short: Simple keyword matching intent classifier. Not intended to be used.
282-
:Outputs: ``intent``
283-
:Requires: nothing
284-
:Output-Example:
285-
286-
.. code-block:: json
287-
288-
{
289-
"intent": {"name": "greet", "confidence": 0.98343}
290-
}
291279

292-
:Description:
293-
This classifier is mostly used as a placeholder. It is able to recognize `hello` and
294-
`goodbye` intents by searching for these keywords in the passed messages.
295280

296281
MitieIntentClassifier
297282
~~~~~~~~~~~~~~~~~~~~~
@@ -485,6 +470,41 @@ EmbeddingIntentClassifier
485470
See `starspace paper <https://arxiv.org/abs/1709.03856>`_ for details.
486471

487472

473+
.. _keyword_intent_classifier:
474+
475+
KeywordIntentClassifier
476+
~~~~~~~~~~~~~~~~~~~~~~~
477+
478+
:Short: Simple keyword matching intent classifier, intended for small, short-term projects.
479+
:Outputs: ``intent``
480+
:Requires: nothing
481+
482+
:Output-Example:
483+
484+
.. code-block:: json
485+
486+
{
487+
"intent": {"name": "greet", "confidence": 1.0}
488+
}
489+
490+
:Description:
491+
This classifier works by searching a message for keywords.
492+
The matching is case sensitive by default and searches only for exact matches of the keyword-string in the user message.
493+
The keywords for an intent are the examples of that intent in the NLU training data.
494+
This means the entire example is the keyword, not the individual words in the example.
495+
496+
.. note:: This classifier is intended only for small projects or to get started. If
497+
you have few NLU training data you can use one of our pipelines
498+
:ref:`choosing-a-pipeline`.
499+
500+
:Configuration:
501+
502+
.. code-block:: yaml
503+
504+
pipeline:
505+
- name: "KeywordIntentClassifier"
506+
case_sensitive: True
507+
488508
Selectors
489509
----------
490510

@@ -496,6 +516,7 @@ Response Selector
496516
:Short: Response Selector
497517
:Outputs: A dictionary with key as ``direct_response_intent`` and value containing ``response`` and ``ranking``
498518
:Requires: A featurizer
519+
499520
:Output-Example:
500521

501522
.. code-block:: json

docs/user-guide/validate-files.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ actions.
4141

4242
**verify_all():** Runs all verifications above.
4343

44+
**verify_domain_validity():** Check if domain is valid.
45+
4446
To use these functions it is necessary to create a `Validator` object and initialize the logger. See the following code:
4547

4648
.. code-block:: python

examples/moodbot/data/nlu.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
- good afternoon
1515

1616
## intent:goodbye
17+
- good afternoon
1718
- cu
1819
- good by
1920
- cee you later
2021
- good night
21-
- good afternoon
2222
- bye
2323
- goodbye
2424
- have a nice day
@@ -42,7 +42,6 @@
4242

4343
## intent:mood_great
4444
- perfect
45-
- very good
4645
- great
4746
- amazing
4847
- feeling like a king
@@ -51,7 +50,7 @@
5150
- I am great
5251
- I am amazing
5352
- I am going to save the world
54-
- super
53+
- super stoked
5554
- extremely good
5655
- so so perfect
5756
- so good
@@ -67,7 +66,7 @@
6766
- sad
6867
- very sad
6968
- unhappy
70-
- not so good
69+
- not good
7170
- not very good
7271
- extremly sad
7372
- so saad

rasa/cli/data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,9 @@ def validate_files(args):
103103
)
104104

105105
validator = loop.run_until_complete(Validator.from_importer(file_importer))
106+
domain_is_valid = validator.verify_domain_validity()
107+
if not domain_is_valid:
108+
sys.exit(1)
109+
106110
everything_is_alright = validator.verify_all(not args.fail_on_warnings)
107111
sys.exit(0) if everything_is_alright else sys.exit(1)

0 commit comments

Comments
 (0)