Я уже много дней пытаюсь решить эту проблему, но не могу получить ожидаемых результатов.
У меня есть информационный фрейм, содержащий разговоры двух человек A & B в каждой строке (это похоже на то, что 1 строка содержит весь разговор, также у меня есть тысячи строк). я хочу отфильтровать строки в каждой строке на основе определенных ключевых слов.
Как я могу это сделать?
Я пробовал ниже строки, но не смог получить точные результаты.
March_Data_fil <- March_Data %>% filter(!str_detect(March_Data, 'Have a good|Thank|day|Ty|thanx|Cheers|How r u|'))
> head(my_data)
Transcript
1 00:00:34 info: You’re now chatting with Bot Virtual Assistant\n00:00:35 Bot: What can I assist with today?\n00:00:35 Bot: \n00:00:45 You: No work\n00:00:48 Bot: Please select your type of work\n00:00:48 Bot: null\n00:00:53 Bot: Please select your location\n00:00:54 Bot: null\n00:01:00 Bot: Thank you, let me connect you with someone to help with this. I'll also pass on the history of our chat.\n00:01:00 Bot: So I can transfer you, please provide me your ID number\n00:18:11 xyz: ill get back to you shortly\n00:18:15 info: Thank you for chatting with us.\n
2 00:05:57 info: You’re now chatting with Bot Virtual Assistant\n00:05:58 Bot: What can I assist with today?\n00:05:58 Bot: \n00:06:17 You: I have no work.\n00:06:19 Bot: Please select your type of work\n00:06:20 Bot: null\n00:06:24 You: I&M\n00:06:25 Bot: Please select your location\n00:06:25 Bot: null\n00:06:28 Bot: Thank you, let me connect you with someone to help with this. I'll also pass on the history of our chat.\n00:06:29 Bot: So I can transfer you, please provide me your ID number\n00:07:49 ***: Thanks\n
3 00:05:57 info: You’re now chatting with Bot Virtual Assistant\n00:05:58 Bot: What can I assist with today?\n00:05:58 Bot: \n00:06:17 You: I have no work.\n00:06:19 Bot: Please select your type of work\n00:06:20 Bot: null\n00:06:24 You: I&M\n00:06:25 Bot: Please select your location\n00:06:25 Bot: null\n00:06:28 Bot: Thank you, let me connect you with someone to help with this. I'll also pass on the history of our chat.\n00:06:29 Bot: So I can transfer you, please provide me your ID number\n00:07:49 ***: Thanks\n
4 00:00:34 info: You’re now chatting with Bot Virtual Assistant\n00:00:35 Bot: What can I assist with today?\n00:00:35 Bot: \n00:00:45 You: No work\n00:00:48 Bot: Please select your type of work\n00:00:48 Bot: null\n00:00:53 Bot: Please select your location\n00:00:54 Bot: null\n00:01:00 Bot: Thank you, let me connect you with someone to help with this. I'll also pass on the history of our chat.\n00:01:00 Bot: So I can transfer you, please provide me your ID number\n00:18:11 xyz: ill get back to you shortly\n00:18:15 info: Thank you for chatting with us.\n
5 00:05:57 info: You’re now chatting with Bot Virtual Assistant\n00:05:58 Bot: What can I assist with today?\n00:05:58 Bot: \n00:06:17 You: I have no work.\n00:06:19 Bot: Please select your type of work\n00:06:20 Bot: null\n00:06:24 You: I&M\n00:06:25 Bot: Please select your location\n00:06:25 Bot: null\n00:06:28 Bot: Thank you, let me connect you with someone to help with this. I'll also pass on the history of our chat.\n00:06:29 Bot: So I can transfer you, please provide me your ID number\n00:07:49 ***: Thanks\n
ID
1 231
2 243
3 222
4 123
5 234
> str(my_data)
'data.frame': 5 obs. of 2 variables:
$ Transcript: chr "00:00:34 info: You’re now chatting with Bot Virtual Assistant\n00:00:35 Bot: What can I assist with today?\n00:"| __truncated__ "00:05:57 info: You’re now chatting with Bot Virtual Assistant\n00:05:58 Bot: What can I assist with today?\n00:"| __truncated__ "00:05:57 info: You’re now chatting with Bot Virtual Assistant\n00:05:58 Bot: What can I assist with today?\n00:"| __truncated__ "00:00:34 info: You’re now chatting with Bot Virtual Assistant\n00:00:35 Bot: What can I assist with today?\n00:"| __truncated__ ...
$ ID : int 231 243 222 123 234
Может кто-нибудь, пожалуйста, помогите мне, я застрял на этом с неделю: (
Спасибо,
Насир