Search code examples
ibm-cloudwatson-conversationwatson-assistant

How to extract special information from Watson Assistant (Conversation)?


I have the user input "What is the hostname of serial GX0211229342?". The serial can be a numeric or alphanumeric mix (e.g. 7842344 or H52WBD1 etc).

How can I extract GX0211229342 from the sentence and set it into context in Watson assistant (Watson Conversation)?


Solution

  • I figure it out, using Watson entity pattern, and the regular expression should be this: ([0-9]+[a-zA-Z]+|[a-zA-Z]+[0-9]+)[0-9a-zA-Z]* it will be used to extract alphanumeric from input. and one more pattern is [0-9]+ it was used to extract numbers. Thank you all help.