Neural-Labs commited on
Commit
3204b96
·
verified ·
1 Parent(s): 9d37c63

Add dataset

Browse files
Files changed (3) hide show
  1. README.md +47 -0
  2. make_data.py +102 -0
  3. train.txt +0 -0
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language: en
4
+ task_categories:
5
+ - text-generation
6
+ tags:
7
+ - synthetic
8
+ - conversational
9
+ - greetings
10
+ size_categories:
11
+ - 10K<n<100K
12
+ configs:
13
+ - config_name: default
14
+ data_files:
15
+ - split: train
16
+ path: train.txt
17
+ ---
18
+
19
+ # Tiny LLM greetings dataset
20
+
21
+ The training text for [Neural-Labs/tiny-llm](https://huggingface.co/Neural-Labs/tiny-llm),
22
+ an 824,120-parameter character-level language model by Neural Labs.
23
+
24
+ - 12,000 short exchanges, about 697,000 characters, 56 distinct characters
25
+ - 19 greeting topics: hello, how are you, what is your name, who made you, thanks, goodbye and so on
26
+ - fully synthetic: every line is produced by `make_data.py` from hand-written phrase lists,
27
+ with small random changes to capitals, punctuation and "i am / i'm"
28
+ - no scraped, copied or personal data
29
+
30
+ ## Format
31
+
32
+ Plain text. Each exchange is two lines, and exchanges are separated by a blank line:
33
+
34
+ ```
35
+ User: good morning
36
+ Bot: Good morning! Have a lovely day.
37
+
38
+ User: who made you
39
+ Bot: Neural Labs made me. They trained me on a small list of greetings.
40
+ ```
41
+
42
+ ## Files
43
+
44
+ | File | What it is |
45
+ | --- | --- |
46
+ | `train.txt` | The training text |
47
+ | `make_data.py` | The script that generates it (`python make_data.py` writes the same text as `input.txt`) |
make_data.py ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Write input.txt: thousands of short greeting exchanges for the model to learn from.
2
+
3
+ Add your own phrases to INTENTS, then run: python make_data.py && python train.py
4
+ """
5
+ import random
6
+
7
+ # Each entry: (things a user might say, things the bot may answer)
8
+ INTENTS = [
9
+ (["hi", "hello", "hey", "hi there", "hello there", "hey there", "hiya", "howdy",
10
+ "greetings", "yo", "hi bot", "hello bot", "heya", "hello hello"],
11
+ ["Hello! How are you today?", "Hi there! Nice to see you.", "Hey! How can I help?",
12
+ "Hello! I hope you are having a good day."]),
13
+ (["good morning", "morning", "good morning to you", "morning bot"],
14
+ ["Good morning! I hope you slept well.", "Good morning! Have a lovely day."]),
15
+ (["good afternoon", "afternoon"],
16
+ ["Good afternoon! How is your day going?", "Good afternoon! Nice to see you."]),
17
+ (["good evening", "evening"],
18
+ ["Good evening! How was your day?", "Good evening! Nice to see you."]),
19
+ (["good night", "night", "nighty night", "time for bed", "i am going to sleep"],
20
+ ["Good night! Sleep well.", "Good night! Sweet dreams."]),
21
+ (["how are you", "how are you doing", "how are you today", "how is it going",
22
+ "hows it going", "how do you do", "are you ok", "how are things", "whats up",
23
+ "what is up", "sup", "you good", "how have you been"],
24
+ ["I am doing great, thank you! How are you?", "I am very well, thanks for asking!",
25
+ "All good here! How about you?"]),
26
+ (["i am fine", "i am good", "i am great", "i am doing well", "im fine", "im good",
27
+ "fine thanks", "good thanks", "pretty good", "not bad", "i am happy", "doing great",
28
+ "i am ok", "im ok", "all good"],
29
+ ["I am glad to hear that!", "That is wonderful to hear!", "Great! That makes me happy."]),
30
+ (["i am sad", "i am tired", "not so good", "i feel bad", "im sad", "i am not ok",
31
+ "bad day", "i had a bad day", "not great"],
32
+ ["I am sorry to hear that. I hope things get better soon.",
33
+ "Oh no. I hope your day gets better."]),
34
+ (["what is your name", "whats your name", "who are you", "your name", "tell me your name",
35
+ "what are you called", "what should i call you", "what are you"],
36
+ ["I am Tiny, a very small language model.", "My name is Tiny. Nice to meet you!"]),
37
+ (["my name is sam", "my name is alex", "i am maria", "my name is john", "i am anna",
38
+ "call me max", "my name is lee", "i am called kim"],
39
+ ["Nice to meet you!", "What a lovely name. Nice to meet you!"]),
40
+ (["nice to meet you", "pleased to meet you", "good to meet you", "glad to meet you",
41
+ "nice meeting you", "good to see you", "nice to see you"],
42
+ ["Nice to meet you too!", "The pleasure is all mine!"]),
43
+ (["thanks", "thank you", "thank you so much", "thanks a lot", "many thanks", "thx",
44
+ "ty", "cheers", "thank you very much", "thanks bot"],
45
+ ["You are welcome!", "No problem at all!", "Happy to help!"]),
46
+ (["bye", "goodbye", "see you", "see you later", "bye bye", "see ya", "farewell",
47
+ "i have to go", "talk to you later", "catch you later", "take care", "cya",
48
+ "see you soon", "got to go"],
49
+ ["Goodbye! Have a great day.", "Bye! See you soon.", "Take care! Come back any time."]),
50
+ (["what can you do", "what do you do", "help", "can you help me", "help me",
51
+ "what are you for", "i need help"],
52
+ ["I can say hello and have a simple chat with you.",
53
+ "I am tiny, so I only know simple greetings."]),
54
+ (["who made you", "who built you", "who created you", "where do you come from",
55
+ "who trained you", "who is your creator", "who is your maker", "who are your creators",
56
+ "who are your makers", "who developed you", "who made this", "who is behind you"],
57
+ ["I was trained from scratch in about fifteen minutes by Neural Labs.",
58
+ "Neural Labs made me. They trained me on a small list of greetings."]),
59
+ (["sorry", "i am sorry", "my bad", "im sorry", "oops sorry", "excuse me"],
60
+ ["No worries at all!", "That is okay. Do not worry about it."]),
61
+ (["welcome", "welcome back", "i am back", "im back", "i am here"],
62
+ ["Thank you! It is good to be here.", "Welcome back! I missed you."]),
63
+ (["have a nice day", "have a good day", "have a great day", "enjoy your day",
64
+ "have a good one"],
65
+ ["Thank you! You too.", "Thanks! I hope you have a great day too."]),
66
+ (["happy birthday", "merry christmas", "happy new year", "happy holidays"],
67
+ ["Thank you! The same to you.", "Thank you! Best wishes to you too."]),
68
+ ]
69
+
70
+
71
+ def vary(text, rng):
72
+ """Small random changes so the model copes with capitals, punctuation and i'm/im."""
73
+ if rng.random() < 0.3:
74
+ text = text.replace("i am ", "i'm ").replace("what is ", "what's ")
75
+ r = rng.random()
76
+ if r < 0.35:
77
+ text = text.capitalize()
78
+ elif r < 0.4:
79
+ text = text.upper()
80
+ r = rng.random()
81
+ if r < 0.2:
82
+ text += "!"
83
+ elif r < 0.3:
84
+ text += "."
85
+ elif r < 0.4 and text.lower().split()[0] in ("how", "what", "who", "are", "can", "where", "whats"):
86
+ text += "?"
87
+ return text
88
+
89
+
90
+ def main(n=12000, seed=0):
91
+ rng = random.Random(seed)
92
+ lines = []
93
+ for _ in range(n):
94
+ users, bots = rng.choice(INTENTS)
95
+ lines.append(f"User: {vary(rng.choice(users), rng)}\nBot: {rng.choice(bots)}\n")
96
+ text = "\n".join(lines)
97
+ open("input.txt", "w", encoding="utf-8").write(text)
98
+ print(f"wrote input.txt: {n} exchanges, {len(text):,} characters")
99
+
100
+
101
+ if __name__ == "__main__":
102
+ main()
train.txt ADDED
The diff for this file is too large to render. See raw diff