Towards Token-Level Text Anomaly Detection
Paper • 2601.13644 • Published
id int64 0 299 | text stringlengths 25 68 | tokens listlengths 6 13 | labels listlengths 6 13 |
|---|---|---|---|
0 | I go to the store everyday. | [
"I",
"go",
"to",
"the",
"store",
"everyday",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
1 | They were playing soccer last night. | [
"They",
"were",
"playing",
"soccer",
"last",
"night",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
2 | She has completed her homework. | [
"She",
"has",
"completed",
"her",
"homework",
"."
] | [
0,
0,
0,
0,
0,
0
] |
3 | He doesn't know the answer. | [
"He",
"doesn",
"'",
"t",
"know",
"the",
"answer",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
4 | The sun rises in the east. | [
"The",
"sun",
"rises",
"in",
"the",
"east",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
5 | I am eating pizza for lunch. | [
"I",
"am",
"eating",
"pizza",
"for",
"lunch",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
6 | The students study for the exam. | [
"The",
"students",
"study",
"for",
"the",
"exam",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
7 | The car needs to be repaired. | [
"The",
"car",
"needs",
"to",
"be",
"repaired",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
8 | She will go to the party tonight. | [
"She",
"will",
"go",
"to",
"the",
"party",
"tonight",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
9 | They watch the movie together. | [
"They",
"watch",
"the",
"movie",
"together",
"."
] | [
0,
0,
0,
0,
0,
0
] |
10 | The flowers bloom in spring. | [
"The",
"flowers",
"bloom",
"in",
"spring",
"."
] | [
0,
0,
0,
0,
0,
0
] |
11 | She thinks she can finish the project. | [
"She",
"thinks",
"she",
"can",
"finish",
"the",
"project",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
12 | The dogs bark at the mail carrier. | [
"The",
"dogs",
"bark",
"at",
"the",
"mail",
"carrier",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
13 | The kids play video games after school. | [
"The",
"kids",
"play",
"video",
"games",
"after",
"school",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
14 | The computer is not working properly. | [
"The",
"computer",
"is",
"not",
"working",
"properly",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
15 | He had slept for ten hours. | [
"He",
"had",
"slept",
"for",
"ten",
"hours",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
16 | I walked to work every day last month. | [
"I",
"walked",
"to",
"work",
"every",
"day",
"last",
"month",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
17 | She will be writing a book next year. | [
"She",
"will",
"be",
"writing",
"a",
"book",
"next",
"year",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
18 | The chef cooks dinner for the guests. | [
"The",
"chef",
"cooks",
"dinner",
"for",
"the",
"guests",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
19 | They plant a tree in the garden. | [
"They",
"plant",
"a",
"tree",
"in",
"the",
"garden",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
20 | I have been to Paris three times. | [
"I",
"have",
"been",
"to",
"Paris",
"three",
"times",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
21 | The cat caught the mouse yesterday. | [
"The",
"cat",
"caught",
"the",
"mouse",
"yesterday",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
22 | The airplane flies over the city. | [
"The",
"airplane",
"flies",
"over",
"the",
"city",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
23 | He does his homework every evening. | [
"He",
"does",
"his",
"homework",
"every",
"evening",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
24 | They were at the concert last night. | [
"They",
"were",
"at",
"the",
"concert",
"last",
"night",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
25 | The computer is running slow today. | [
"The",
"computer",
"is",
"running",
"slow",
"today",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
26 | She buys a new dress for the party. | [
"She",
"buys",
"a",
"new",
"dress",
"for",
"the",
"party",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
27 | The birds sing in the morning. | [
"The",
"birds",
"sing",
"in",
"the",
"morning",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
28 | He will finish the race in an hour. | [
"He",
"will",
"finish",
"the",
"race",
"in",
"an",
"hour",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
29 | She makes a cake for her friend's birthday. | [
"She",
"makes",
"a",
"cake",
"for",
"her",
"friend",
"'",
"s",
"birthday",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
30 | The train leaves at 6 PM. | [
"The",
"train",
"leaves",
"at",
"6",
"PM",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
31 | They were listening to music. | [
"They",
"were",
"listening",
"to",
"music",
"."
] | [
0,
0,
0,
0,
0,
0
] |
32 | The scientist performs experiments in the lab. | [
"The",
"scientist",
"performs",
"experiments",
"in",
"the",
"lab",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
33 | The baby cries when it's hungry. | [
"The",
"baby",
"cries",
"when",
"it",
"'",
"s",
"hungry",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
34 | The teacher teaches the students in the classroom. | [
"The",
"teacher",
"teaches",
"the",
"students",
"in",
"the",
"classroom",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
35 | I was working on the project all day. | [
"I",
"was",
"working",
"on",
"the",
"project",
"all",
"day",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
36 | She painted her room last week. | [
"She",
"painted",
"her",
"room",
"last",
"week",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
37 | The dog was chasing the squirrel. | [
"The",
"dog",
"was",
"chasing",
"the",
"squirrel",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
38 | The flowers were watered by the gardener. | [
"The",
"flowers",
"were",
"watered",
"by",
"the",
"gardener",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
39 | The car has been washed this morning. | [
"The",
"car",
"has",
"been",
"washed",
"this",
"morning",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
40 | The manager gave a speech at the meeting. | [
"The",
"manager",
"gave",
"a",
"speech",
"at",
"the",
"meeting",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
41 | They take a vacation every summer. | [
"They",
"take",
"a",
"vacation",
"every",
"summer",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
42 | He swam in the pool every day last summer. | [
"He",
"swam",
"in",
"the",
"pool",
"every",
"day",
"last",
"summer",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
43 | The athlete won the gold medal in the race. | [
"The",
"athlete",
"won",
"the",
"gold",
"medal",
"in",
"the",
"race",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
44 | She was dancing at the party last night. | [
"She",
"was",
"dancing",
"at",
"the",
"party",
"last",
"night",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
45 | The teacher graded the papers all night. | [
"The",
"teacher",
"graded",
"the",
"papers",
"all",
"night",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
46 | The children built a sandcastle on the beach. | [
"The",
"children",
"built",
"a",
"sandcastle",
"on",
"the",
"beach",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
47 | The company will launch a new product next month. | [
"The",
"company",
"will",
"launch",
"a",
"new",
"product",
"next",
"month",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
48 | I have been studying for the test for two weeks. | [
"I",
"have",
"been",
"studying",
"for",
"the",
"test",
"for",
"two",
"weeks",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
49 | The photographer took a picture of the sunset. | [
"The",
"photographer",
"took",
"a",
"picture",
"of",
"the",
"sunset",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
50 | The artist was drawing a portrait of the model. | [
"The",
"artist",
"was",
"drawing",
"a",
"portrait",
"of",
"the",
"model",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
51 | He reads a book before going to bed. | [
"He",
"reads",
"a",
"book",
"before",
"going",
"to",
"bed",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
52 | The player scored a goal during the match. | [
"The",
"player",
"scored",
"a",
"goal",
"during",
"the",
"match",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
53 | The tourists visited the museum yesterday. | [
"The",
"tourists",
"visited",
"the",
"museum",
"yesterday",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
54 | The weather forecast says it will rain tomorrow. | [
"The",
"weather",
"forecast",
"says",
"it",
"will",
"rain",
"tomorrow",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
55 | The farmer has planted the seeds in the field. | [
"The",
"farmer",
"has",
"planted",
"the",
"seeds",
"in",
"the",
"field",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
56 | She has been making dinner for the family. | [
"She",
"has",
"been",
"making",
"dinner",
"for",
"the",
"family",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
57 | The students were studying for their exams. | [
"The",
"students",
"were",
"studying",
"for",
"their",
"exams",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
58 | The concert will begin in an hour. | [
"The",
"concert",
"will",
"begin",
"in",
"an",
"hour",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
59 | The neighbors were moving out yesterday. | [
"The",
"neighbors",
"were",
"moving",
"out",
"yesterday",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
60 | The children had fun at the amusement park. | [
"The",
"children",
"had",
"fun",
"at",
"the",
"amusement",
"park",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
61 | The pilot was flying the plane during the storm. | [
"The",
"pilot",
"was",
"flying",
"the",
"plane",
"during",
"the",
"storm",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
62 | She has baked cookies for the bake sale. | [
"She",
"has",
"baked",
"cookies",
"for",
"the",
"bake",
"sale",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
63 | The waiter served the food to the customers. | [
"The",
"waiter",
"served",
"the",
"food",
"to",
"the",
"customers",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
64 | The author has been writing a new book. | [
"The",
"author",
"has",
"been",
"writing",
"a",
"new",
"book",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
65 | The delivery driver brought the package yesterday. | [
"The",
"delivery",
"driver",
"brought",
"the",
"package",
"yesterday",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
66 | The students were taking a test in the classroom. | [
"The",
"students",
"were",
"taking",
"a",
"test",
"in",
"the",
"classroom",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
67 | He is taking a break from work. | [
"He",
"is",
"taking",
"a",
"break",
"from",
"work",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
68 | The party was organized by the event planner. | [
"The",
"party",
"was",
"organized",
"by",
"the",
"event",
"planner",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
69 | The mechanic fixed the car. | [
"The",
"mechanic",
"fixed",
"the",
"car",
"."
] | [
0,
0,
0,
0,
0,
0
] |
70 | The movie starts at 8 PM. | [
"The",
"movie",
"starts",
"at",
"8",
"PM",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
71 | The gardener is planting flowers in the garden. | [
"The",
"gardener",
"is",
"planting",
"flowers",
"in",
"the",
"garden",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
72 | The team was working on the project. | [
"The",
"team",
"was",
"working",
"on",
"the",
"project",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
73 | The musician performed at the concert. | [
"The",
"musician",
"performed",
"at",
"the",
"concert",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
74 | She is going shopping after work. | [
"She",
"is",
"going",
"shopping",
"after",
"work",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
75 | The store closes at 9 PM tonight. | [
"The",
"store",
"closes",
"at",
"9",
"PM",
"tonight",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
76 | The cat was lying on the sofa. | [
"The",
"cat",
"was",
"lying",
"on",
"the",
"sofa",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
77 | The engine is making a strange noise. | [
"The",
"engine",
"is",
"making",
"a",
"strange",
"noise",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
78 | The students are preparing for their presentations. | [
"The",
"students",
"are",
"preparing",
"for",
"their",
"presentations",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
79 | The volunteers were helping at the event. | [
"The",
"volunteers",
"were",
"helping",
"at",
"the",
"event",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
80 | The birds were flying south for the winter. | [
"The",
"birds",
"were",
"flying",
"south",
"for",
"the",
"winter",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
81 | The cake was baked in the oven. | [
"The",
"cake",
"was",
"baked",
"in",
"the",
"oven",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
82 | The package was delivered yesterday. | [
"The",
"package",
"was",
"delivered",
"yesterday",
"."
] | [
0,
0,
0,
0,
0,
0
] |
83 | The athlete is training for the competition. | [
"The",
"athlete",
"is",
"training",
"for",
"the",
"competition",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
84 | The car was washed by the teenager. | [
"The",
"car",
"was",
"washed",
"by",
"the",
"teenager",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
85 | She is speaking at the conference tomorrow. | [
"She",
"is",
"speaking",
"at",
"the",
"conference",
"tomorrow",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
86 | The doctor examined the patient. | [
"The",
"doctor",
"examined",
"the",
"patient",
"."
] | [
0,
0,
0,
0,
0,
0
] |
87 | The store opens late on Fridays. | [
"The",
"store",
"opens",
"late",
"on",
"Fridays",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
88 | The tree fell during the storm. | [
"The",
"tree",
"fell",
"during",
"the",
"storm",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
89 | The children were playing in the park. | [
"The",
"children",
"were",
"playing",
"in",
"the",
"park",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
90 | The cake is frosted with chocolate icing. | [
"The",
"cake",
"is",
"frosted",
"with",
"chocolate",
"icing",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
91 | The employee is working late tonight. | [
"The",
"employee",
"is",
"working",
"late",
"tonight",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
92 | The train was delayed due to bad weather. | [
"The",
"train",
"was",
"delayed",
"due",
"to",
"bad",
"weather",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
93 | The phone is charging on the table. | [
"The",
"phone",
"is",
"charging",
"on",
"the",
"table",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
94 | The dog was digging a hole in the yard. | [
"The",
"dog",
"was",
"digging",
"a",
"hole",
"in",
"the",
"yard",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
95 | The students are studying in the library. | [
"The",
"students",
"are",
"studying",
"in",
"the",
"library",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
96 | The pizza was delivered to the wrong address. | [
"The",
"pizza",
"was",
"delivered",
"to",
"the",
"wrong",
"address",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
97 | The project was completed by the deadline. | [
"The",
"project",
"was",
"completed",
"by",
"the",
"deadline",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
98 | The concert was canceled due to rain. | [
"The",
"concert",
"was",
"canceled",
"due",
"to",
"rain",
"."
] | [
0,
0,
0,
0,
0,
0,
0,
0
] |
99 | The waitress is taking our order. | [
"The",
"waitress",
"is",
"taking",
"our",
"order",
"."
] | [
0,
0,
0,
0,
0,
0,
0
] |
Text anomaly detection datasets with a 0/1 anomaly label for every word, used by the PyTextAD library. A document is anomalous if any of its words is anomalous, so each dataset serves both token-level and document-level evaluation.
from pytextad.datasets import load_dataset # pip install pytextad
ds = load_dataset("restaurant_review")
ds.tokens, ds.token_labels, ds.labels
| Dataset | Documents | Anomalous | Words | Anomalous words | Anomaly |
|---|---|---|---|---|---|
sms_spam |
4,518 | 393 | 81,570 | 418 | injected gibberish |
restaurant_review |
1,100 | 50 | 35,488 | 282 | negative sentiment |
grammar_correction |
300 | 30 | 2,746 | 47 | grammatical errors |
hate_speech |
4,302 | 140 | 99,390 | 288 | hateful or offensive words |
olid |
650 | 30 | 21,156 | 58 | offensive words |
restaurant_review2 |
520 | 25 | 33,529 | 94 | negative sentiment |
Each line of a file is one document: {"id", "text", "tokens", "labels"}, where labels
has one 0/1 value per entry of tokens.
sms_spam: SMS Spam Collection, taken from NLP-ADBench;
meaningless character sequences were injected into some messages.restaurant_review: Google Maps reviews of a restaurant in the USA.grammar_correction: Kaggle grammar-correction.hate_speech: tweets from Davidson et al., Automated Hate Speech Detection and the Problem
of Offensive Language, ICWSM 2017.olid: tweets from Zampieri et al., Predicting the Type and Target of Offensive Posts in
Social Media (OLID), NAACL 2019.restaurant_review2: reviews of a second restaurant.The word-level annotations are released under CC BY 4.0; the texts remain subject to the terms of their original sources.
The first three datasets were introduced in Towards Token-Level Text Anomaly Detection:
@inproceedings{cao2026tokenlevel,
title = {Towards Token-Level Text Anomaly Detection},
author = {Cao, Yang and Yu, Bicheng and Yang, Sikun and Liu, Ming and Yang, Yujiu},
booktitle = {Proceedings of the ACM Web Conference 2026 (WWW '26)},
year = {2026},
doi = {10.1145/3774904.3792952}
}