0

For example: converting a string “three hundred dollars and twelve cents” to return “$300.12” back.

Siri does this well, but I can’t find open tools to do this. I'd like to parse numerical and monetary values from textual input returned from a Speech2Text service I'm currently using.

kashkar
  • 663
  • 1
  • 8
  • 22

2 Answers2

1

Assuming english, for Microsoft LUIS, prebuilt number, dimension, and money are good to include. LUIS will return more than one, if it matches. Prebuilt Reference doc

DFBerry
  • 1,818
  • 1
  • 19
  • 37
0

You should have a look to Microsoft's Recognizers-Text project, hosted on GitHub here.

It is available as a Nuget package for C# for example, or npm package for javascript.

Example (.Net samples on GitHub):

// Currency recognizer will find any currency presented
// E.g "Interest expense in the 1988 third quarter was $ 75.3 million" will return "75300000 Dollar"
NumberWithUnitRecognizer.RecognizeCurrency(query, culture);
Nicolas R
  • 13,812
  • 2
  • 28
  • 57