
An Upgrade to SyntaxNet, New Models and a Parsing Competition - liviosoares
https://research.googleblog.com/2017/03/an-upgrade-to-syntaxnet-new-models-and.html
======
jacquesm
I've been fighting Tensorflow in the last couple of days to try an application
on it, never before have I seen such a convoluted build process and a maze of
dependencies. The best manual on getting tensorflow with CUDA support up and
running is here:

[http://www.nvidia.com/object/gpu-accelerated-applications-
te...](http://www.nvidia.com/object/gpu-accelerated-applications-tensorflow-
installation.html)

But it is a little bit out of date when it comes to version numbers.

If you're going to try TensorBox
([https://github.com/TensorBox/TensorBox](https://github.com/TensorBox/TensorBox))
it will get a bit harder still because of conflicts and build issues with
specific versions of TensorFlow.

There has to be an easier way to distribute a package.

That said, all this is super interesting and Google really moved the needle by
opensourcing TensorFlow and other ML packages.

~~~
jorgemf
It is not a good idea to compile TensorFlow by your own unless you really need
it (for example for TensorFlow serving). Python packages are the way to go.

~~~
aseipp
This is a bit unfortunate, in a real sense. I mean, I already build enough
software, so I'm not sad on missing out. But here's the thing: TensorFlow
actually installed _great_ on Windows and it took less than 10 minutes to get
running, once I had Python3 installed, even with GPU support. Even worked
awesome in VS Code, out of the box, with autocomplete in the python mode. Even
a baby like me got started easily.

But it's a bit disappointing to hear that the build system is something of a
nightmare, if I ever wanted to contribute myself. There's always plenty of
things to help with, I don't care about the cutting edge of machine learning
(I'm happy to submit docs, examples, etc)... Then again, the TF people can't
just nerd around on their build system, for dorks like me to maybe write some
patches every once in a while. Always great to make it easier, though.

~~~
jacquesm
For me the issue with such things is not so much the hassle as much as it is
long term stability of an environment that I come to depend on. If I can't
reproduce it from archived sources then there is a good chance that at some
point in the future my stuff will suddenly and in-explicably stop working
after some minor system update.

And python has a huge problem with this anyway. (Or, to put it probably more
accurately, I have a huge problem with python in this way, historically my
python code has had a relatively short shelf life compared to my C code (or
even my PHP code)).

------
qeternity
Given how many areas NLP can be applied to, I can only imagine all of these
future internal project proposals where someone has to explain to some C-suite
exec how they are going to revolutionize the business with Parsey McParseface.
Or better yet, when they have to budget a big upgrade to the "DRAGNN based
ParseySaurus". Fun times ahead.

~~~
ucaetano
Sounds like a way to troll other organizations and competitors, imagine the
conversations:

 _-(Eng) We need to switch to this new NLP framework_

 _\- (VP) Ok, why? Which one is it?_

 _\- (Eng) Huh, it 's called Parsey McParseface, developed by ..._

 _\- (VP) WTF? Don 't waste my time with jokes, go build your own_

 _\- (Eng) But ..._

 _\- (VP) Meeting 's over._

------
minimaxir
See also: spaCy, which is an open-source NLP framework that has some
integration with Keras as well:
[https://news.ycombinator.com/item?id=13874787](https://news.ycombinator.com/item?id=13874787)

...and apparently will release a major version update _today_. Ouch.

~~~
syllogism
Why ouch? :). It's not like there's a zero-sum game here. It's great to see
more things being released, so the ecosystem can continue to improve.

I do wish SyntaxNet were a bit easier to use. A lot of people have asked for
SyntaxNet as a backend for spaCy, and I'd love to be using it in a training
ensemble. When I tried this last year, I had a lot of trouble getting it to
work as a library. I spent days trying to pass it text in memory from Python,
and it seemed like I would have to write a new C++ tensorflow op. Has anyone
gotten this to work yet?

~~~
Tpt
There is
[https://github.com/livingbio/syntaxnet_wrapper](https://github.com/livingbio/syntaxnet_wrapper)
that does the job fairly well (I also spent days trying to be able to pass to
SyntaxNet different textes without having to reload the model). Warning:
installation is a bit difficult.

------
devy
"Python 3 support is not available yet." [1]. It's only supported in Python
2.7, Why?

[1]
[https://github.com/tensorflow/models/tree/master/syntaxnet](https://github.com/tensorflow/models/tree/master/syntaxnet)

~~~
RussianCow
Probably because Google still mostly uses Python 2.7 internally.

~~~
devy
Yikes! Not being to run on Py3k is a deal breaker for me.

~~~
akinalci
It's definitely an unfortunate situation. The community has been coalescing
around Python 3 in the last couple years, but Google is obviously encumbered
by all its legacy Python 2.7 code. Their SyntaxNet library still doesn't have
Python 3 support a year after release. I'm wondering what their long-term
plans are given 2.7 EOL in 2020.

------
pbnjay
This looks amazing. I'm especially curious how well it will work at
identifying Gene/chemical nomenclature since it is fairly consistent like
English spelling. For named entity recognition in biomedical text this could
be really useful!

------
dang
We changed the title from "Google open-sources Tensorflow-based framework for
NLP", which appears misleading, given that it happened last May:
[https://news.ycombinator.com/item?id=11686029](https://news.ycombinator.com/item?id=11686029).

On HN the idea is to rewrite titles only to make them _less_ misleading (or
less baity). Please see
[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html).

~~~
liviosoares
dang, sorry if this seemed misleading. In my humble opinion, the blog title
does not do full justice to the new release, primarily since it carries a new
framework within SyntaxNet:

[https://github.com/tensorflow/models/blob/master/syntaxnet/g...](https://github.com/tensorflow/models/blob/master/syntaxnet/g3doc/DRAGNN.md)

This new DRAGNN framework is what I thought the folks here would want to know.
Perhaps I should have linked to the github page, rather than the blog
announcement.

~~~
dang
Ah, I see. Probably a post pointing to that framework would have been a better
idea. It never fails to surprise me, but discussion tends to be directed
almost entirely by what's in a submission title.

For the same reason, it probably doesn't make sense to change the current
thread to point to that Github page now, since that would orphan the existing
discussion.

------
webmaven
Very interesting release.

The bit about guessing the part of speech, stem, etc. for previously unseen
words _should_ (I think) make it much more useful in contexts that succumb to
neologizing, verbing nouns, nouning verbs, and so on (such as business
writing, technical writing, academic papers, science fiction & fantasy, slang,
etc.).

I wonder how well it would do at parsing something that seems deliberately
impenetrable, like TimeCube rants, or postmodern literary criticism.

~~~
PeterisP
It's much more useful in _all_ contexts - every problem/task has a 100 words
that are very common and important there while being rare and unknown in
general; the problem is that for every niche that's _different_ 100 terms.

~~~
webmaven
Right, except in terms of neologizing I was referring to contexts where many
individual _texts_ are trying to establish a new term. So if you are trying to
parse Science Fiction texts, yes there are "terms of art" that don't appear
outside of that field (eg. "blaster"), but often there are terms that don't
appear _anywhere_ else, not even in other works by the same author.

Other pathological cases are business books trying to coin a term or twist
existing words into new meanings (eg. "cloud"), verbing nouns (incentivize),
nouning verbs (likes, learnings), and so on.

------
tlow
For those of us who aren't developers but maybe more aptly called "hackers"
(cause we hack stuff together even though we're operating out of our league,
sometimes we get stuff to work). I am wondering, is there a even higher level
guide to using Tensor Flow. I am currently growing Sweet Peas in my office in
enclosed containers that automanage environment, nutrition and water. I have
the capaability to log a lot of data from a lot of sensors, including images.
I have _no idea_ how I would even get started using Tensor Flow, but it would
be cool if I could run experiments on environmental conditions and find
optimal conditions for this sweet pea cultivar. Maybe I'm talking nonsense.
Let me ask a more basic question, how might one log and create data for use
with Tensor Flow. How might Tensor Flow be applied to robotic botanical
situations?

~~~
minimaxir
The short answer is to skip TensorFlow entirely and use/learn Keras for a
high-level overview; then you can learn top-down if you need to use/look at TF
code directly.

Another HN thread has good tutorials for simple uses of Tensorflow:
[https://news.ycombinator.com/item?id=13464496](https://news.ycombinator.com/item?id=13464496)

However, NNs are optimal for text/image data as they can learn the features.
If your data features are already known, you don't necessarily need to use
Tensorflow/Keras at all, and you'll have a easier time using conventional
techniques like linear/logistic regression and xgboost.

~~~
Houshalter
sklearn has this flowchart for what machine learning method to use:
[http://scikit-learn.org/stable/_static/ml_map.png](http://scikit-
learn.org/stable/_static/ml_map.png)

~~~
minimaxir
The flowchart predates NNs/GBTs which are Swiss-army knives, which is another
reason why using either of them is sometimes considered cheating.

~~~
Houshalter
NNs are much older than this chart. They aren't terribly good at problems like
this because they tend to overfit more than other methods. They need lots of
data to generalize well. They only really excel when the data has regular
structure that can be exploited by weight sharing (like CNNs to images or RNNs
to time series.)

------
jakekovoor
This is definitely a game changer!

It's a very interesting research carried out by Google's research team and I
believe this will be especially beneficial for future speech translation
algorithms that would bring us a whole new, fresh experience with the way we
converse with Alexa, Google Home, Siri, and many more.

If you need to install TensorFlow onto your Windows 10 computer then here's a
great guide which I have followed quiet a few times. :)

[http://saintlad.com/install-tensorflow-on-
windows/](http://saintlad.com/install-tensorflow-on-windows/)

------
canada_dry
Hoping this will quickly make into someone's home grown self-hosted version of
Alexa.

Alexa, turn the lights on in the kitchen.

Alexa, turn on the kitchen light.

Alexa, light up the kitchen.

Should all accomplish the same task using this framework.

~~~
squeaky-clean
I've been slowly working on my own simple home "Alexa" using mostly CMUSphinx
for the voice detection. Honestly my most successful methods involved the
least amount of complex NLP.

Just simply treating the sentence as a bag of words and looking for "on" or
"off" or "change" (and their synonyms) and the presence of known smart objects
works extremely well. I could say "Hey Marvin, turn on the lights and TV", or
"Hey Marvin, turn the lights and TV on", or even "Hey Marvin, on make lights
and TV."

(It's named Marvin it after the android from The Hitchhiker's Guide, my
eventual goal is to have it reply with snarky/depressed remarks).

Adding 30 seconds of "memory" of the last state requested also made it seem a
million times smarter and turns requests into a conversation rather than a
string of commands. If it finds a mentioned smart object with no state
mentioned, it assume the previous one.

"Hey Marvin, turn on the lights." _lights turn on_ "The TV too." _tv turns on_

The downside to this approach is I would be showing it off to friends, and it
could mis trigger. "Marvin turn off the lights." _lights turn off_ "That's so
cool, so it controls your TV, too?" _TV turns off_ But it was mostly not an
issue in real usage.

Ultimately I've got the project on hold for now because I can't find a decent,
non-commercial way of converting voice to text. I'd really rather not send my
audio out to Amazon/Google/MS/IBM. Not just because of privacy, but cost and
"coolness" factor (I want as much as possible processed locally and open-
source).

CMUSphinx's detection was mostly very bad. I couldn't even do complex NLP if I
wanted because it picks up broken/garbled sentences. I currently build a "most
likely" sentence by looping through sphinx's 20 best interpretations of the
sentence and grabbing all the words that are likely to be commands or smart
objects. I tried setting up Kaldi, but didn't get it working after a weekend
and haven't tried again since. I don't really know any other options to use
aside from CMUSphone, Kaldi, or a butt SaaS.

I've wanted to add a text messaging UI layer to it. Maybe I'll use that as an
excuse to try playing with ParseySaurus.

~~~
canada_dry
> I've got the project on hold for now because I can't find a decent, non-
> commercial way of converting voice to text. I'd really rather not send my
> audio out to Amazon/Google/MS/IBM

Same concern here... so my voice->text method is via android's google voice -
forced to offline mode. The offline mode is surprisingly good.

Re mis triggers... I also have opencv running on the same android. It only
activates the voice recognition when I am actually looking directly at the
android device (an old phone).

~~~
squeaky-clean
> text method is via android's google voice - forced to offline mode. The
> offline mode is surprisingly good.

I actually tried this at one point with a wall-mounted tablet before trying
Sphinx. It is surprisingly good for offline, probably the best offline I've
tried yet outside of dedicated software like Dragon. But it doesn't meet my
open criteria, so I'm hoping to find something better.

I'll most likely give up on the requirements of it needing to be local and
open, and use Sphinx for hotword detection to send the audio out to AWS for
processing.

> Re mis triggers... I also have opencv running on the same android. It only
> activates the voice recognition when I am actually looking directly at the
> android device (an old phone).

That's an awesome idea :) I haven't gotten around to playing with anything
vision based yet. But I've thought of 'simple' projects like that, which would
add a lot to the perceived intelligence. Figuring out the number of people in
a room would be another useful idea I think. The AI could enter a guest mode
when there is more than 1 person in the room, or when it detects faces that
aren't mine, or something similar.

~~~
canada_dry
> doesn't meet my open criteria

With the leaps and bounds being made in ml these days it can't be long before
magnitudes better open source voice recognition becomes available. I gave
Sphinx a try but it was horribly disappointing.

For me, the combination of google voice (offline) and Ivona voice (Amy) is
pretty damn good for my android/python/arduino based home AI.

------
coding123
I've been rummaging through the docs on DRAGONN but can't seem to find proper
installation/run instructions. There is a Google Cloud installation, but I
want to just run on my laptop for now against the pre-trained files. Can't
seem to get started with DRAGONN.

~~~
coding123
Thank you thank you Ivan Bogatyy for fixing the docker run instructions. I
think it was missing the docker image name before! :)

------
camdenlock
> and to allow neural-network architectures to be created dynamically during
> processing of a sentence or document.

Oh lord, is this the spark that lights the google skynet powder keg

~~~
PeterisP
Not yet, you'd need to apply the same approach to agentive (decisions on how
to act) problems as opposed to classification tasks; _then_ you'd have the
spark that lights the google skynet powder keg.

------
David23
I have tried to run Syntaxnet as library but I found it very difficult (lot of
dependencies).

