【发布时间】:2021-04-29 18:53:40
【问题描述】:
我正在处理儿童所说的话语和陈述。从每个话语中,如果语句中的一个或多个单词与多个“核心”单词(可能是 300 个单词)的预定义列表匹配,那么我想在“核心”中输入“1”(如果没有,则输入“0”进入“核心”)。
同样,如果语句中有一个或多个单词匹配不同的预定义“边缘”单词列表(可能是 300 个边缘单词;同样与核心单词不同),那么我想输入“1”进入“边缘”(如果没有,则在“边缘”中输入“0”)。
基本上,现在我只有话语,我需要确定是否有任何单词与核心单词匹配并匹配任何边缘单词。这是我的数据的 sn-p。
Core Fringe Utterance
1 NA NA small
2 NA NA small
3 NA NA where's his bed
4 NA NA there's his bed
5 NA NA there's his bed
6 NA NA is that a pillow
提前致谢。我搜索了档案,但很难找到与我的情况相对应的解决方案。
dput() 代码是:
structure(list(Utterance = c("small", "small", "where's his bed", "there's his bed", "there's his bed", "is that a pillow", "what is that on his head", "hey he has his arm stuck here", "there there's it", "now you're gonna go night_night", "and that's the thing you can turn on", "yeah where's the music+box"), Core = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), Fringe = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA)), class = "data.frame", row.names = c(NA, -12L))
【问题讨论】:
-
你能显示sn-p的预期输出吗