Skip to content

Commit

Permalink
Merge b6aa58a into 8e559ae
Browse files Browse the repository at this point in the history
  • Loading branch information
jack57lee committed Sep 9, 2019
2 parents 8e559ae + b6aa58a commit d384325
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ genie download-dataset -o dataset.tt
```

The resulting `synthesized.tsv` file can be used to train directly. To do so, skip to Step 4, Dataset preprocessing. If you wish instead to paraphrase, you'll probably want to restrict the synthesized set
to paraphrase-friendly construct templates, by passing `--flag-set turking` on the command line.
to paraphrase-friendly construct templates, by passing `--set-flag turking` on the command line.

NOTE: the `generate` command can require significant amounts of memory. If you experience out of memory,
it can help to invoke `node` as:
Expand Down
132 changes: 122 additions & 10 deletions languages/en/filters.genie
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,38 @@ atom_filter = {
return C.makeFilter($options, p, '==', x, true);
};

p:the_out_param_Numeric 'is' ('greater' | 'higher' | 'bigger' | 'more' | 'at least' | 'not less than') x:constant_Numeric => C.makeFilter($options, p, '>=', x);
p:the_out_param_Numeric 'is' ('smaller' | 'lower' | 'less' | 'at most' | 'not more than') x:constant_Numeric => C.makeFilter($options, p, '<=', x);
//p:the_out_param_Numeric 'is' ('greater' | 'higher' | 'bigger' | 'more' | 'at least' | 'not less than') x:constant_Numeric => C.makeFilter($options, p, '>=', x);
//p:the_out_param_Numeric 'is' ('smaller' | 'lower' | 'less' | 'at most' | 'not more than') x:constant_Numeric => C.makeFilter($options, p, '<=', x);

p:out_param_Number 'is' ('greater than' | 'higher than' | 'larger than' | 'more than' | 'at least' | 'not less than') x:constant_Number => C.makeFilter($options, p, '>=', x);
p:out_param_Number 'is' ('smaller than' | 'lower than' | 'less than' | 'at most' | 'not more than') x:constant_Number => C.makeFilter($options, p, '<=', x);

p:out_param_Currency 'is' ('more expensive' | 'more costly' | 'more') 'than' x:constant_Currency => C.makeFilter($options, p, '>=', x);
p:out_param_Currency 'is' ('less expensive' | 'cheaper' | 'less') 'than' x:constant_Currency => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_ms 'is' 'longer than' x:constant_Measure_ms => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_ms 'is' 'shorter than' x:constant_Measure_ms => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_byte 'is' ('larger' | 'more') 'than' x:constant_Measure_byte => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_byte 'is' ('smaller' | 'less') 'than' x:constant_Measure_byte => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_kg 'is' ('heavier' | 'larger') 'than' x:constant_Measure_kg => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_kg 'is' ('lighter' | 'smaller') 'than' x:constant_Measure_kg => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_C 'is' ('hotter' | 'higher') 'than' x:constant_Measure_C => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_C 'is' ('cooler' | 'colder' | 'lower') 'than' x:constant_Measure_C => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_m 'is' ('farther' | 'more distant' | 'longer') 'than' x:constant_Measure_m => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_m 'is' ('nearer' | 'closer' | 'shorter') 'than' x:constant_Measure_m => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_mps 'is' ('faster' | 'quicker' | 'speedier') 'than' x:constant_Measure_mps => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_mps 'is' ('slower' | 'more slowly') 'than' x:constant_Measure_mps => C.makeFilter($options, p, '<=', x);

!turking {
p:the_out_param_Date 'is' ('after' | 'later than') x:constant_Date => C.makeFilter($options, p, '>=', x);
p:the_out_param_Date 'is' ('before' | 'earlier than') x:constant_Date => C.makeFilter($options, p, '<=', x);
p:out_param_Date 'is' ('after' | 'later than') x:constant_Date => C.makeFilter($options, p, '>=', x);
p:out_param_Date 'is' ('before' | 'earlier than' | 'sooner than') x:constant_Date => C.makeFilter($options, p, '<=', x);
p:out_param_Time 'is' ('after' | 'later than') x:constant_Time => C.makeFilter($options, p, '>=', x);
p:out_param_Time 'is' ('before' | 'earlier than' | 'sooner than') x:constant_Time => C.makeFilter($options, p, '<=', x);
}

// there are too few arrays, so keep both
Expand All @@ -77,8 +103,37 @@ edge_filter = {
else
return C.makeFilter($options, p, '==', x);
};
p:the_out_param_Numeric ('is now greater than' | 'becomes greater than' | 'becomes higher than' | 'goes above' | 'increases above' | 'goes over' | 'rises above') x:constant_Numeric => C.makeFilter($options, p, '>=', x);
p:the_out_param_Numeric ('is now smaller than' | 'becomes smaller than' | 'becomes lower than' | 'goes below' | 'decreases below' | 'goes under') x:constant_Numeric => C.makeFilter($options, p, '<=', x);
//p:the_out_param_Numeric ('is now greater than' | 'becomes greater than' | 'becomes higher than' | 'goes above' | 'increases above' | 'goes over' | 'rises above') x:constant_Numeric => C.makeFilter($options, p, '>=', x);
//p:the_out_param_Numeric ('is now smaller than' | 'becomes smaller than' | 'becomes lower than' | 'goes below' | 'decreases below' | 'goes under') x:constant_Numeric => C.makeFilter($options, p, '<=', x);

p:out_param_Number ('is now' | 'becomes' | 'goes') ('greater than' | 'higher than' | 'larger than' | 'more than' | 'at least' | 'not less than') x:constant_Number => C.makeFilter($options, p, '>=', x);
p:out_param_Number ('is now' | 'becomes' | 'goes') ('smaller than' | 'lower than' | 'less than' | 'at most' | 'not more than') x:constant_Number => C.makeFilter($options, p, '<=', x);

p:out_param_Currency ('is now' | 'becomes' | 'goes') ('more expensive' | 'more costly' | 'more') 'than' x:constant_Currency => C.makeFilter($options, p, '>=', x);
p:out_param_Currency ('is now' | 'becomes' | 'goes') ('less expensive' | 'cheaper' | 'less') 'than' x:constant_Currency => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_ms ('is now' | 'becomes' | 'goes') 'longer than' x:constant_Measure_ms => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_ms ('is now' | 'becomes' | 'goes') 'shorter than' x:constant_Measure_ms => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_byte ('is now' | 'becomes' | 'goes') ('larger' | 'more') 'than' x:constant_Measure_byte => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_byte ('is now' | 'becomes' | 'goes') ('smaller' | 'less') 'than' x:constant_Measure_byte => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_kg ('is now' | 'becomes' | 'goes') ('heavier' | 'larger') 'than' x:constant_Measure_kg => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_kg ('is now' | 'becomes' | 'goes') ('lighter' | 'smaller') 'than' x:constant_Measure_kg => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_C ('is now' | 'becomes' | 'goes') ('hotter' | 'higher') 'than' x:constant_Measure_C => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_C ('is now' | 'becomes' | 'goes') ('cooler' | 'colder' | 'lower') 'than' x:constant_Measure_C => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_m ('is now' | 'becomes' | 'goes') ('farther' | 'more distant' | 'longer') 'than' x:constant_Measure_m => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_m ('is now' | 'becomes' | 'goes') ('nearer' | 'closer' | 'shorter') 'than' x:constant_Measure_m => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_mps ('is now' | 'becomes' | 'goes') ('faster' | 'quicker' | 'speedier') 'than' x:constant_Measure_mps => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_mps ('is now' | 'becomes' | 'goes') ('slower' | 'more slowly') 'than' x:constant_Measure_mps => C.makeFilter($options, p, '<=', x);

p:out_param_Date ('is now' | 'becomes' | 'goes') ('after' | 'later than') x:constant_Date => C.makeFilter($options, p, '>=', x);
p:out_param_Date ('is now' | 'becomes' | 'goes') ('before' | 'earlier than' | 'sooner than') x:constant_Date => C.makeFilter($options, p, '<=', x);
p:out_param_Time ('is now' | 'becomes' | 'goes') ('after' | 'later than') x:constant_Time => C.makeFilter($options, p, '>=', x);
p:out_param_Time ('is now' | 'becomes' | 'goes') ('before' | 'earlier than' | 'sooner than') x:constant_Time => C.makeFilter($options, p, '<=', x);
}

either_filter = {
Expand Down Expand Up @@ -160,10 +215,67 @@ with_filter = {
!turking p:out_param_String ('containing' | 'including') x:constant_String => C.makeFilter($options, p, '=~', x);
!turking x:constant_String ('in the' | 'in its' | 'in their') p:out_param_String => C.makeFilter($options, p, '=~', x);

p:out_param_Numeric ('higher' | 'larger' | 'bigger') 'than' x:constant_Numeric => C.makeFilter($options, p, '>=', x);
p:out_param_Numeric ('smaller' | 'lower') 'than' x:constant_Numeric => C.makeFilter($options, p, '<=', x);
('higher' | 'larger' | 'bigger') p:out_param_Numeric 'than' x:constant_Numeric => C.makeFilter($options, p, '>=', x);
('smaller' | 'lower') p:out_param_Numeric 'than' x:constant_Numeric => C.makeFilter($options, p, '<=', x);
//p:out_param_Numeric ('higher' | 'larger' | 'bigger') 'than' x:constant_Numeric => C.makeFilter($options, p, '>=', x);
//p:out_param_Numeric ('smaller' | 'lower') 'than' x:constant_Numeric => C.makeFilter($options, p, '<=', x);
p:out_param_Number ('greater than' | 'higher than' | 'larger than' | 'more than' | 'at least' | 'not less than') x:constant_Number => C.makeFilter($options, p, '>=', x);
p:out_param_Number ('smaller than' | 'lower than' | 'less than' | 'at most' | 'not more than') x:constant_Number => C.makeFilter($options, p, '<=', x);

p:out_param_Currency ('more expensive' | 'more costly' | 'more') 'than' x:constant_Currency => C.makeFilter($options, p, '>=', x);
p:out_param_Currency ('less expensive' | 'cheaper' | 'less') 'than' x:constant_Currency => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_ms 'longer than' x:constant_Measure_ms => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_ms 'shorter than' x:constant_Measure_ms => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_byte ('larger' | 'more') 'than' x:constant_Measure_byte => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_byte ('smaller' | 'less') 'than' x:constant_Measure_byte => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_kg ('heavier' | 'larger') 'than' x:constant_Measure_kg => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_kg ('lighter' | 'smaller') 'than' x:constant_Measure_kg => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_C ('hotter' | 'higher') 'than' x:constant_Measure_C => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_C ('cooler' | 'colder' | 'lower') 'than' x:constant_Measure_C => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_m ('farther' | 'more distant' | 'longer') 'than' x:constant_Measure_m => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_m ('nearer' | 'closer' | 'shorter') 'than' x:constant_Measure_m => C.makeFilter($options, p, '<=', x);

p:out_param_Measure_mps ('faster' | 'quicker' | 'speedier') 'than' x:constant_Measure_mps => C.makeFilter($options, p, '>=', x);
p:out_param_Measure_mps ('slower' | 'more slowly') 'than' x:constant_Measure_mps => C.makeFilter($options, p, '<=', x);

p:out_param_Date ('after' | 'later than') x:constant_Date => C.makeFilter($options, p, '>=', x);
p:out_param_Date ('before' | 'earlier than' | 'sooner than') x:constant_Date => C.makeFilter($options, p, '<=', x);
p:out_param_Time ('after' | 'later than') x:constant_Time => C.makeFilter($options, p, '>=', x);
p:out_param_Time ('before' | 'earlier than' | 'sooner than') x:constant_Time => C.makeFilter($options, p, '<=', x);

//('higher' | 'larger' | 'bigger') p:out_param_Numeric 'than' x:constant_Numeric => C.makeFilter($options, p, '>=', x);
//('smaller' | 'lower') p:out_param_Numeric 'than' x:constant_Numeric => C.makeFilter($options, p, '<=', x);
('greater' | 'higher' | 'larger' | 'more') p:out_param_Number 'than' x:constant_Number => C.makeFilter($options, p, '>=', x);
('smaller' | 'lower' | 'less') p:out_param_Number 'than' x:constant_Number => C.makeFilter($options, p, '<=', x);

('more expensive' | 'more costly' | 'more') p:out_param_Currency 'than' x:constant_Currency => C.makeFilter($options, p, '>=', x);
('less expensive' | 'cheaper' | 'less') p:out_param_Currency 'than' x:constant_Currency => C.makeFilter($options, p, '<=', x);

'longer' p:out_param_Measure_ms 'than' x:constant_Measure_ms => C.makeFilter($options, p, '>=', x);
'shorter' p:out_param_Measure_ms 'than' x:constant_Measure_ms => C.makeFilter($options, p, '<=', x);

('larger' | 'more') p:out_param_Measure_byte 'than' x:constant_Measure_byte => C.makeFilter($options, p, '>=', x);
('smaller' | 'less') p:out_param_Measure_byte 'than' x:constant_Measure_byte => C.makeFilter($options, p, '<=', x);

('heavier' | 'larger') p:out_param_Measure_kg 'than' x:constant_Measure_kg => C.makeFilter($options, p, '>=', x);
('lighter' | 'smaller') p:out_param_Measure_kg 'than' x:constant_Measure_kg => C.makeFilter($options, p, '<=', x);

('hotter' | 'higher') p:out_param_Measure_C 'than' x:constant_Measure_C => C.makeFilter($options, p, '>=', x);
('cooler' | 'colder' | 'lower') p:out_param_Measure_C 'than' x:constant_Measure_C => C.makeFilter($options, p, '<=', x);

('farther' | 'more distant' | 'longer') p:out_param_Measure_m 'than' x:constant_Measure_m => C.makeFilter($options, p, '>=', x);
('nearer' | 'closer' | 'shorter') p:out_param_Measure_m 'than' x:constant_Measure_m => C.makeFilter($options, p, '<=', x);

('faster' | 'quicker' | 'speedier') p:out_param_Measure_mps 'than' x:constant_Measure_mps => C.makeFilter($options, p, '>=', x);
('slower' | 'more slowly') p:out_param_Measure_mps 'than' x:constant_Measure_mps => C.makeFilter($options, p, '<=', x);

'later' p:out_param_Date 'than' x:constant_Date => C.makeFilter($options, p, '>=', x);
('earlier' | 'sooner') p:out_param_Date 'than' x:constant_Date => C.makeFilter($options, p, '<=', x);
'later' p:out_param_Time 'than' x:constant_Time => C.makeFilter($options, p, '>=', x);
('earlier' | 'sooner') p:out_param_Time 'than' x:constant_Time => C.makeFilter($options, p, '<=', x);

!turking {
f:range_with_filter => f;
Expand Down
Loading

0 comments on commit d384325

Please sign in to comment.