Live data from Hacker News

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

news.ycombinator.com

1–10 of 27 posts

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

#1
For the past 6 months I’ve been working on a Natural Language Understanding (NLU) API. Essentially the request would contain a plain english sentence, and the response would include a breakdown of actions, entities, agents, location, temporal, logic, etc. My hope was that I could create a “Stripe/Twilio for NLU”, but recent feedback has been that it’s more a “technology”, and less a “product”. It would still require a lot of development work to create anything of value for an end user. While I see the value of an API, I also agree with their sentiment, and so I’ve begun exploring problems to apply my API to.

One use case that tends to pop up frequently is “text-to-database”. Similar to text-to-SQL, but with my API I could target any DB regardless of query language. This would require a large amount of work, and I’m not convinced that it’s something that users even want. The strongest feedback I’ve received has been that it would be a convenient method for managers and non-technical to query analytics databases.

Is this a path worth exploring? Are there industries or positions that would kill to be able to query a db with a plain english sentence? Is this something that you would use, or want to implement?

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

#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 correct one, and got your answers. It worked very well for queries like, "show me all employees hired after 2020-01-01 who's salary is greater than 80,000 sorted by salary descending".

Ultimately though, I think the usefulness of these tools breaks down for both complex queries and even simple ones when the data model does not have explicit relationships defined.

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

#4
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.

I don't disagree, but this would not be a 1-1 mapping, if that matters.

>From my experience, what keeps non-technical people from writing queries isn't SQL, it's stuff like joins.

I've met very few non-technical folks willing to brave learning any part of SQL. In my case joins would be an implementation detail, mostly handled by the product, but possibly with an escape hatch for technical folks.

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

#5
This seems like it could have enough value to build a customer base around? Or for someone to want to purchase the rights to the tech so they could build around it?

Selling such a thing should not be a problem given the right target. Not only has the customer space for technologies like that changed over time, but you are providing a new twist on the solution.

> “Stripe/Twilio for NLU”, but recent feedback has been that it’s more a “technology”, and less a “product”

That comment doesn't make a ton of sense to me. Are services not valuable? Stripe and Twilio seem like really helpful services and that seems...OK to me?

Personally I get excited when I hear about an ease-of-use wrapper around regex. But for a DB, in place of that regular messy query stuff with the prospect of things like multiple LEFT JOINS? That's a big deal.

And even if it doesn't tick every box it will probably I'd guess it would have its unique applications for a given set of customers.

Like let's say sets of people who would like to prototype to well-enough using their ability to sit around and talk in English all day long, and then hand off to someone else. The average person's energy pool for trying different sentences, even considering some expected failure rate, is so much deeper than the resources available for trying and failing with different SQL statements.

This would also apply to those who are not really working with the data to work with it. Let's say they are selling data-viz tools and want a quick way to make prototypes from the potential customer's sample data. There, boom, product example. I guess.

It sounds really cool. Good luck, hope it works out for you.

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

#6
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…

1990's huh, wow. I totally believe it. It almost feels like a solved problem, but when I tried to find an API that parsed text to a degree that was usable by an average dev, nothing came up. Many NLP/AI/ML tools could define the entities, or VERY general relationships, but never went far enough. I'm curious if the 90's solutions used ML, or if they went straight to text analysis (which is what I'm using).

> Ultimately though, I think the usefulness of these tools breaks down for both complex queries and even simple ones when the data model does not have explicit relationships defined.

Makes sense. Do you think it would help if a developer could define the relationships in the data model ahead of time?

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

#7
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, that upper-level manager who keeps asking for reports for which the HN person has to figure out how to get the data. Handing that manager a tool like this, and letting them run their own queries could get them out of our hair. (It could also be better for the manager, as they run the query, look at the results, and figure out that it wasn't actually the data they were looking for, and so they can iterate the query to get what they're really after.)

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

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

#8

This seems like it could have enough value to build a customer base around? Or for someone to want to purchase the rights to the tech so they could build around it? Selling such a thing should not be a problem given the right target. Not only has the customer space for technologies like that changed over time, but you are providing a new twist on the solution. > “Stripe/Twilio for NLU”, but recent feedback has been t…

> That comment doesn't make a ton of sense to me. Are services not valuable? Stripe and Twilio seem like really helpful services and that seems...OK to me?

Services are totally valuable! I think with Stripe and Twilio they both solve a problem a Business/PM/Owner has. The conversations go something like this in my head:

PM: I want to be able to send SMS messages to my customers.

Dev: Uh, I don't know anything about telecom...

Twilio: I do! I'm way cheaper than a dev working this problem. Just use me.

For NLU, I'm not sure I've been able to find PMs that are wanting to "understand the plain english of our users". But I know there is a decent amount of NLP usage. Do PM's just not know that they can ask for these NLP? Or do they just not need it? I'm not sure. I feel a little bit like I'm missing a piece of the puzzle.

> Personally I get excited when I hear about an ease-of-use wrapper around regex. But for a DB, in place of that regular messy query stuff with the prospect of things like multiple LEFT JOINS? That's a big deal.

A regex wrapper is an interesting idea. Maybe I'll try it out. I agree that a text to db wrapper could be a good idea, if it works really well.

> The average person's energy pool for trying different sentences, even considering some expected failure rate, is so much deeper than the resources available for trying and failing with different SQL statements.

Great point!

> It sounds really cool. Good luck, hope it works out for you.

Thank you, me too :)

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

#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...

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

#10
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 will give the same data as somebody who uses slightly different phrasing. SQL gives a lot more precision and I would hate to lose that due to a layer of abstraction.

But English -> SQL (with something like Github Copilot, built on other analysts' queries) would be very interesting although not "get out my wallet and purchase" compelling.

Post reply on HN