Live data from Hacker News

Ask HN: If you could talk to a database in plain English, would you?

news.ycombinator.com

11–20 of 27 posts

Re: Ask HN: If you could talk to a database in plain English, would you?

#11

No. Absolutely not. I want to say precisely what I mean and have the database do precisely what I say, no more, no less. But maybe you're asking the wrong question in your headline. If you could have other people in your organization able to talk to a database in plain English, would you? This isn't something that most of the HN crowd would want for their own work. There might be a lot of people here who have, say, t…

Ah, yes, Maybe I should clarify who my intended user would be. I agree that if you are technical, you are probably better off using other query methods. I'm always surprised what folks are on here, so was hoping a few would find this question.

> There might be a lot of people here who have, say, that upper-level manager who keeps asking for reports for which the HN person has to figure out how to get the data.

This is 100% the use case I was thinking.

> One caveat, though: I wouldn't want to hand anyone - even a professional - write access with this kind of a tool.

Agree! Not sure how this ever would be safe enough for edits.

Re: Ask HN: If you could talk to a database in plain English, would you?

#13
post #2

No. Trying to map english to formal logic is a fools errand. From my experience, what keeps non-technical people from writing queries isn't SQL, it's stuff like joins.

>Trying to map english to formal logic is a fools errand.

Perfect description of a developer's job.

"WANTED: One Fool to serve the court at the pleasure of the CEO. Compensation is one crust of bread and a flagon of ale per day."

Re: Ask HN: If you could talk to a database in plain English, would you?

#14
post #9
post #3

I remember first playing with tech like this in the early 1990's. Q&A v4 from Symantec supported NLP and I was quite surprised at how potentially useful it looked, although as a developer I preferred more control. After typing your query, the app would display its interpretation of your request in more formal English to confirm it understood you. When there was ambiguity a few options were presented. You selected the…

Symantec Q&A was released in 1985. https://en.wikipedia.org/wiki/Q%26A_%28Symantec%29 For various definitions of query, the work goes back to the 1950s https://developer.ibm.com/articles/a-beginners-guide-to-natu...

The Symantec link is fascinating, thank you for that!

Re: Ask HN: If you could talk to a database in plain English, would you?

#15

Have you tried gathering sample queries from real people? I previously worked at a company that tried this briefly. They gave up after getting the first sample of queries real users typed in.

Not yet specifically for this; It is an excellent point.

If I may, was there any particular phrases that you remember that were "too much"?

It would be great to talk more about your experience, if you are open. Just let me know and I can DM you.

Re: Ask HN: If you could talk to a database in plain English, would you?

#16

There is something in this space that I think would have value... maybe translation from English -> SQL, maybe suggest commonly used WHERE clause filters, etc. At the end of the day, SQL is very expressive for most of these queries, but it's not particularly discoverable and does take some knowledge. Lowering that barrier to entry is a great idea, but otherwise I'm not sure if an analyst can be certain their query wi…

English->SQL is very much a thing, and has a good amount of research going into it. It does have a few weaknesses though:

1. It is ML based, and the best results I have seen put it at about 90% accurate. This might be "good enough", but not perfect. Verification and error correction is needed.

2. Knowledge of the schema needs to be passed in as part of the feature, or have the model explicitly trained to the target schema.

3. Going to a different DB requires a retraining of the model, due to slight differences in SQL dialects.

4. ML takes either a lot of time (speed) or money (GPUs). This is more a general ML problem, but does affect English -> SQL.

I am no expert in English -> SQL, or in ML in general, so somebody correct me if I'm wrong on the above points. These are just what I've seen or experienced in my research.

Re: Ask HN: If you could talk to a database in plain English, would you?

#17

Have you tried gathering sample queries from real people? I previously worked at a company that tried this briefly. They gave up after getting the first sample of queries real users typed in.

Not yet specifically for this; It is an excellent point. If I may, was there any particular phrases that you remember that were "too much"? It would be great to talk more about your experience, if you are open. Just let me know and I can DM you.

Given that I was not in the group, I can't provide any great detail. It sounded like people entered extremely vague sentence fragments.

Re: Ask HN: If you could talk to a database in plain English, would you?

#18
Having used various things that claim to be natural language, I find that to use them effectively, I end up needing to learn their particular structured language. These are often poorly documented and may have pretty weird/difficult edge cases (one often seen and easy to explain case is selecting lists with plural nouns and individual records with singular nouns... But many english nouns have the same spelling and pronounciation as plural and singular).

Regardless of the details of the language, if I'm going to learn a structured language anyway, I would usually prefer to learn the underlying language, and not an imperfect abstraction. Sometimes, there's good value in the abstraction, but I usually find they get in the way and make it harder to do what I want.

Re: Ask HN: If you could talk to a database in plain English, would you?

#19

Earlier quoted context omitted.

Not yet specifically for this; It is an excellent point. If I may, was there any particular phrases that you remember that were "too much"? It would be great to talk more about your experience, if you are open. Just let me know and I can DM you.

Given that I was not in the group, I can't provide any great detail. It sounded like people entered extremely vague sentence fragments.

Ah, copy that. Not enough input is, well, not enough. Appreciate the clarification.

Re: Ask HN: If you could talk to a database in plain English, would you?

#20
post #18

Having used various things that claim to be natural language, I find that to use them effectively, I end up needing to learn their particular structured language. These are often poorly documented and may have pretty weird/difficult edge cases (one often seen and easy to explain case is selecting lists with plural nouns and individual records with singular nouns... But many english nouns have the same spelling and pr…

> Having used various things that claim to be natural language, I find that to use them effectively, I end up needing to learn their particular structured language.

This makes sense. Are there any specific examples of products that you have used that you had to do this?

> ...selecting lists with plural nouns and individual records with singular nouns...

Yes, this is for sure a failure case. I believe I have some means to work around this, fwiw.

> if I'm going to learn a structured language anyway, I would usually prefer to learn the underlying language, and not an imperfect abstraction.

I feel like I get what you are saying here, but some more concrete examples would help. Is there a "structured language" you are referring to?

Post reply on HN