import requests
import json

base_url = "http://112.30.115.188:15598/bnf/pre?sentence="


def get_nlp_result(text):
    # 发送GET请求
    response = requests.get(base_url + text)
    if text.startswith('打开大数据可视化平台'):
        return ('{"code":200,"msg":"ok","result":{"matchText":"打开大数据可视化平台","results":[[{"match_bgn":"0",'
                '"match_end":"7","match_num":"80","match_text":"打开大数据可视化平台","mind_name":"open_system","slot_num":"1",'
                '"slots":[{"match_bgn":2,"match_end":7,"match_text":"大数据可视化平台","slot_name":"system",'
                '"slot_value":"大数据可视化平台"}]}]]}}')
    else:
        # 解析JSON响应数据
        return response.text
