交互语法树
项目部署在GitPage, 版本号1.0.0
一棵语法树可以用来描述句子的产生规则,配合句子模拟器可以生成若干模拟句子
语法树是一棵有序树,即交换语法树的各个子树可能导致语义变化
{
"type": "root",
"children": [
{
"type": "holder",
"children": []
}, {
"type": "intent",
"intent": "搜会议",
"weight": 0.25,
"children": []
}
]
}
{
"type": "holder",
"children": []
}
{
"type": "intent",
"intent": "搜会议",
"weight": 0.25,
"children": []
}
| “type”: < “order” | “pickone” | “exchangeable” > |
{
"type": "pickone",
"name": "选取一条规则",
"dropout": 0.5,
"children": [{
"type": "order",
"name": "规则1",
"weight": 0.5,
"children": []
}, {
"type": "exchangeable",
"name": "规则2",
"weight": 1.5,
"children": []
}]
}
| “from_file”: < true | false > |
{
"type": "content",
"from_file": false,
"dropout": 0.2,
"content": [
"给我",
"想找",
"想要",
"想要找",
"查",
"查询",
"检索",
"显示",
"展示",
"查找"
]
}
一个生成询问会议的语法树的JSON示例:
{
"type": "root",
"children": [{
"type": "holder",
"children": []
}, {
"type": "intent",
"intent": "venue",
"weight": 0.2,
"children": [{
"type": "order",
"name": "ask_venue_root",
"children": [{
"type": "order",
"name": "search_node",
"children": [{
"type": "content",
"from_file": false,
"dropout": 0.2,
"content": [
"给我",
"想找",
"想要",
"想要找",
"查",
"查询",
"检索",
"显示",
"展示",
"查找"
]
}, {
"type": "content",
"from_file": false,
"dropout": 0.3,
"content": [
"一些",
"一组",
"一批",
"几个"
]
}]
}, {
"type": "pickone",
"name": "ex_keyword_node",
"children": [{
"type": "order",
"children": [{
"type": "content",
"from_file": false,
"content": [
"有关",
"关于"
]
}, {
"type": "content",
"from_file": true,
"filename": "aminer_keywords_zh.txt",
"entity": "KEY",
"name": "keyword_node"
}, {
"type": "content",
"from_file": false,
"content": [
"方面",
"方向",
"领域"
]
}, {
"type": "content",
"from_file": false,
"content": [ "的" ]
}]
}, {
"type": "order",
"children": [{
"type": "content",
"from_file": false,
"content": [
"和",
"与"
]
}, {
"type": "content",
"from_file": true,
"filename": "aminer_keywords_zh.txt",
"entity": "KEY",
"name": "keyword_node"
}, {
"type": "content",
"from_file": false,
"content": [
"相关",
"有关"
]
}, {
"type": "content",
"from_file": false,
"content": [ "的" ]
}]
}]
}, {
"type": "content",
"from_file": false,
"content": [
"期刊",
"会议"
]
}]
}]
}]
}
通过交互操作生成规则语法树,下载语法树json文件,利用句子模拟器生成模拟句子
新创建的兴趣节点会添加到兴趣列表的尾端,可通过Intent List改变兴趣节点顺序
- order:顺序节点,模拟器按顺序产生每个子节点内容,顺序连接
- pickone:选择节点,模拟器从子节点中选择一个节点生成内容
- exchangeable:可换节点,模拟器按顺序产生每个子节点内容,shuffle这些内容后连接
按照如下步骤创建一个控制节点:
新创建的控制节点会挂载到棕色超根节点的尾端
最后一个分隔符后的内容被认为是内容出现的词频
新创建的内容节点会挂载到棕色超根节点的尾端
- 只有控制节点和叶节点可被拖动
- 只有兴趣节点和控制节点可挂载节点
只能在同类节点中切换节点类别。具体来说,只有控制节点可以在三种类型间切换
该文件可用于句子模拟器
仅保证导入由模拟器生成的调试树和由导出树导出文件时的行为
该功能行为还未最终确定