Then I realised that my caledonian-light grammar doesn't actually use logical variables, so I went and implemented that in WASP. Seems to work, ok. I even have the hinted grammar working and trained.
generating paired input/sentences
I came to my senses about trying to use pCRU to generate the set of possible MRs (i was doing something really hacky and complicated). So now instead of trying to generate English and MR texts independently and then try to align them by grammar-hacking, I have a simple Haskell script that dumps out the list of possible pairs via list comprehensions (probably would be just as easy to write this in Python). Having this made life a lot easier, especially when I wanted to generate both hinted and unhinted sentence/input pairs:combos = map withHint cs ++ map sansHint cs
where
cs = [ C lse (":leaves(" ++ ts ++ "," ++ ds ++ ")") (unwords [te,lse,de])
| lse <- [ "leaves" , "departs" ]
, (ds,de) <- departures
, (ts,te) <- trains
]
sansHint (C _ s e) = (s,e)
withHint (C h s e) = ("lex(leaves,"++h++")"++s,e)
Yeah it's probably not very readable, but that's what you get in quickie get-the-job-done scripts.
more notes
SCFG init rules are really useful for preventing the lexical acquisition module from learning the wrong thing. Before, it was learning things like:TIME -> in the morning and six ; 1800because it only saw examples like "leaves at 10 in the morning and 6 in the evening", i.e. where the first time was in the morning. If you gave it an input like
times(1300, 1800), you would get the wrong output ("leaves at 1 in the morning and 6 in the evening" instead of the expected "leaves at 1 in the evening and 6 in the morning" [yeah, should be afternoon, but nevermind that for now]). This was pretty easy to fix. You just feed an initial rule like TIME -> one in the evening ; 1300to guide it towards a more reasonable result. In fact, I had to do something like this just to prevent the system from learning completely nonsensical things like:
TIME -> london ; 1800
Hmm. Maybe just having MOAR DATA would fix it too.
Another thought is that if I recall correctly, everything has to be aligned to something. You can soften this a bit by putting in zero-fertility constraints on the rules. But you occasionally want to just elide a whole bunch of stuff (but not always). Seems like this could be tricky.
closer inspection?
I kinda have a suspicion that stuff like this might be sneaking through in NLG evaluations... but I dunno. Maybe people are just really careful to ensure that systems are really producing output that communicates the correct things (and not just sounds like English / is readable). In the above example, 1 in the morning and 1 in the evening are, err... quite different. Another interesting thing you can say about this is that this is something you can definitely not fix with type-checking the parse output (if you were doing parsing and not generation)sumtime
I've started working on generating weather reports. I've got a toy MRL grammar that can be trained on a single pair (and several variations). Next I'm going to do a little bit of scripting to convert the data from AB's scripts into the format that WASP (and my grammar) wants. Should be pretty straightforward. No logical variables here, still very exploratory stuff. I'm still generating segments here, and not full reports. Start small.another problem/solution pair
Problem:Exception in thread "main" java.lang.RuntimeException
at wasp.nl.SRINgramModel.exec(SRINgramModel.java:184)
at wasp.nl.SRINgramModel.train(SRINgramModel.java:128)
Solution: not sure. I simplified my MRL grammar an it went away

