[246357] Conversation Labels Auto-Bot

220 Conversations | 2,863 Posts + (510 from users, 2,353 from bots) | 4 Uploaded Images +

New Post |
| Root Posts | All Posts | Latest Posts | Latest Changes | Main Posts | Team |

By stefan. Created 2020/12/02 21:56:08, modified 2020/12/04 16:09:47

Post type: JavaX Code (Live Auto Bot)

Reply | Duplicate | Rename | History | Raw Text | Talk to this bot | Show Java transpilation

In reference to:

sclass Bot > GazelleAutoBot {
  O calc() {
    if (!eqic(postType, "Detailed Conversation Mirror")) null;
    
    L msgs = safeUnstructList(post);
    
    // key = (time, msg text), value = label text
    new Map<Pair<Long, S>, S> labels;
    
    for (O msg : msgs) {
      long time = rget_long time(msg);
      S text = rget_string text(msg);
      bool isQuestion = ai_isQuestion_2(text);
      S label = isQuestion ? "question" : "";
      if (nempty(label))
        labels.put(pair(time, text), label);
    }
    
    if (empty(labels)) null;
    
    ret createPost(
      type := "Line Labels",
      text := struct(labels),
      overrideLastPost := true);
  }
}

sO calc() { ret Bot; }

Referenced by posts (latest first):