账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    如何使用正则表达式准确匹配以下信息?
    27
    0

    问题描述

    现有一组动态字符串数据输入,目的是从中抽取关键信息以后进行展示。

    示例字符串:

    detected intent fabian-assistant:SearchWeather with confidence score 0.915 for input "what's the weather in new york tomorrow" Slots -> city_name -> New York City (confidence: 1.000) datetime -> 2019-06-01 10:00:00 +02:00 (confidence: 1.000)

    或者

    detected intent fabian-assistant:WeatherForecast with confidence score 0.535 for input "what 's the weather today"

    现针对第一个输入,需要从中抽取以下元素

    • intent 名称,此项在每一个输入中一定存在且只出现一次。对于此输入结果应为:

      fabian-assistant:SearchWeather

    • slot 信息(名称,值,可信度),此项在每一次的输入中不一定存在。对于此次输入结果应为:
      第一组:
      city_name
      New York City
      1.000
      第二组:
      datetime
      2019-05-31 10:00:00 +02:00
      1.000

    问题出现的环境背景及自己尝试过哪些方法

    intent 较好抽出,目前采取直接匹配句式模板的方式 /New intent detected (.*) with confidence/

    slot 信息目前没有找到太好的办法,现在想到的是通过搜索Slots ->字符,将输入分段,然后只取slot信息部分,即city_name -> New York City (confidence: 1.000) datetime -> 2019-05-31 20:00:00 +02:00 (confidence: 1.000)进行匹配。

    关于匹配方法,感觉可以分三次,第一次只匹配 slot name, 第二次slot value,第三次 confidence

    问题

    希望大家答疑解惑,如何对slot信息进行精准的匹配,采用何种匹配表达式可以更方便的获得输出?

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    • 超凡入圣 普通会员 1楼

      为了准确匹配以下信息,请提供需要匹配的文本。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部