Repository: isi-vista/adam

Issue:
Handle core vocabulary verb: Take
Take (~1200): almost always takes an NP (>1100), majority with ADVP/PP 

Take: almost all particles, occasionally with NPs


Comments:

Patch:
diff --git a/adam/curriculum/phase1_curriculum.py b/adam/curriculum/phase1_curriculum.py
index daa19537..45777354 100644
--- a/adam/curriculum/phase1_curriculum.py
+++ b/adam/curriculum/phase1_curriculum.py
@@ -63,6 +63,7 @@ from adam.ontology.phase1_ontology import (
     is_recognized_particular,
     on,
     strictly_above,
+    TAKE,
 )
 from adam.ontology.phase1_spatial_relations import (
     AWAY_FROM,
@@ -892,6 +893,41 @@ def _make_sit_curriculum():
     )
 
 
+def _make_take_curriculum():
+    taker = object_variable("taker_0", required_properties=[ANIMATE])
+    object_taken = object_variable(
+        "object_taken_0",
+        required_properties=[INANIMATE],
+        banned_properties=[IS_BODY_PART],
+    )
+
+    # X puts Y on Z
+    take_template = Phase1SituationTemplate(
+        "take",
+        salient_object_variables=[taker, object_taken],
+        actions=[
+            Action(
+                TAKE, argument_roles_to_fillers=[(AGENT, taker), (THEME, object_taken)]
+            )
+        ],
+        constraining_relations=[Relation(BIGGER_THAN, taker, object_taken)],
+    )
+
+    return _phase1_instances(
+        "taking",
+        chain(
+            *[
+                sampled(
+                    take_template,
+                    max_to_sample=25,
+                    chooser=_CHOOSER,
+                    ontology=GAILA_PHASE_1_ONTOLOGY,
+                )
+            ]
+        ),
+    )
+
+
 GAILA_PHASE_1_CURRICULUM = [
     EACH_OBJECT_BY_ITSELF_SUB_CURRICULUM,
     OBJECTS_WITH_COLORS_SUB_CURRICULUM,
@@ -910,6 +946,7 @@ GAILA_PHASE_1_CURRICULUM = [
     _make_sit_curriculum(),
     _make_put_curriculum(),
     _make_eat_curriculum(),
+    _make_take_curriculum(),
 ]
 """
 One particular instantiation of the curriculum for GAILA Phase 1.
diff --git a/adam/ontology/phase1_ontology.py b/adam/ontology/phase1_ontology.py
index 78afff65..c2157492 100644
--- a/adam/ontology/phase1_ontology.py
+++ b/adam/ontology/phase1_ontology.py
@@ -1088,7 +1088,14 @@ _TAKE_ACTION_DESCRIPTION = ActionDescription(
         partOf(_TAKE_MANIPULATOR, _TAKE_AGENT),
     ],
     preconditions=[negate(has(_TAKE_AGENT, _TAKE_THEME))],
-    postconditions=[has(_TAKE_AGENT, _TAKE_THEME)],
+    postconditions=[
+        has(_TAKE_AGENT, _TAKE_THEME),
+        Relation(
+            IN_REGION,
+            _TAKE_THEME,
+            Region(_TAKE_MANIPULATOR, distance=EXTERIOR_BUT_IN_CONTACT),
+        ),
+    ],
     asserted_properties=[
         (_TAKE_AGENT, VOLITIONALLY_INVOLVED),
         (_TAKE_AGENT, CAUSES_CHANGE),


Test patch:
diff --git a/tests/curriculum/phase1_curriculum_test.py b/tests/curriculum/phase1_curriculum_test.py
index 6a775b19..94694316 100644
--- a/tests/curriculum/phase1_curriculum_test.py
+++ b/tests/curriculum/phase1_curriculum_test.py
@@ -10,6 +10,7 @@ from adam.curriculum.phase1_curriculum import (
     _make_transfer_of_possession_curriculum,
     _make_sit_curriculum,
     _make_put_curriculum,
+    _make_take_curriculum,
 )
 
 
@@ -60,3 +61,7 @@ def test_sit():
 
 def test_put():
     _test_curriculum(_make_put_curriculum())
+
+
+def test_take():
+    _test_curriculum(_make_take_curriculum())