Closed c-martinez closed 9 years ago
Great idea, but needs testing. Also, I think it's a better idea to feed data as JSON on the semanticizer's stdin; that allows for more options.
The Travis failure is unrelated, looks like the latest Go build broke the C-Go bindings. Will fix that.
It would be also nice to update the README with some documentation on how to use the wrapper.
... and there needs to be a way to install it. I'll merge the wrapper into a separate branch.
I'll add some documentation on how to use the wrapper to the README.
For the testing -- I'm assuming we use the 'nlwiki-20140927-sample.xml' to build a test model?
I think another worry would be the overhead of having python to start a shell process (which on its turn) accesses databases and so on. An http wrapper over the go server might perform better, no ?
Another thought would be just develop some very small python code, that just reads the data from the model and exposes that directly (if the data format is the same as semanticizest, we could use that directly, I'm not sure it is though)
HTTP wrapper would be better if go server runs on different machine -- but I'm guessing that is what will have to be done if we want st to be integrated into xtas. Shell process is intended as a quick-and-easy way of getting started.
Reading the model from Python, I think would be possible, but I thought the hash functions used in go might require a bit of work.
Perhaps @larsmans has an opinion on this?
Reading the model "directly" means doing the exact same tokenization and hashing, so keeping two implementations aligned.
In cfbc2b3613ca0b489eebcb8adaf2827b7414eed2, I made it easier to start an HTTP server locally, using a random port number.
Now using HTTP instead of subprocess (although http server can be started on a subprocess). So it can run locally (for ease) or using a remote server (for performance).
82a3a647c52bdee265001109a4f64fa2b6de43ce is a refactoring of this code.
Merged most of this from the command line. Python wrapper is now in master. Thanks @c-martinez! (Now to get Travis to run the tests...)
Probably trivial, but maybe nice to have.