Laz4rz commited on
Commit
db17956
1 Parent(s): bac7c1b

Update README.md

Browse files

# ScienceWikiSmallChunk

Processed version of millawell/wikipedia_field_of_science, prepared to be used in small context length RAG systems. Chunk length is tokenizer dependent, but each chunk should be around 512 tokens. Longer wikipedia pages have been split into smaller entries, with title added as a prefix.

If you wish to prepare some other chunk length:
- use millawell/wikipedia_field_of_science
- adapt chunker function:
```
def chunker_clean(results, example, length=512, approx_token=3, prefix=""):
if len(results) == 0:
regex_pattern = r'[\n\s]*\n[\n\s]*'
example = re.sub(regex_pattern, " ", example).strip().replace(prefix, "")
chunk_length = length * approx_token
if len(example) > chunk_length:
first = example[:chunk_length]
chunk = ".".join(first.split(".")[:-1])
if len(chunk) == 0:
chunk = first
rest = example[len(chunk)+1:]
results.append(prefix+chunk.strip())
if len(rest) > chunk_length:
chunker_clean(results, rest.strip(), length=length, approx_token=approx_token, prefix=prefix)
else:
results.append(prefix+rest.strip())
else:
results.append(prefix+example.strip())
return results
```

Files changed (1) hide show
  1. README.md +19 -3
README.md CHANGED
@@ -1,3 +1,19 @@
1
- ---
2
- license: cc-by-sa-3.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ pretty_name: ScienceWikiSmallChunk
5
+ tags:
6
+ - RAG
7
+ - Retrieval Augmented Generation
8
+ - Small Chunks
9
+ - Wikipedia
10
+ - Science
11
+ - Scientific
12
+ - Scientific Wikipedia
13
+ - Science Wikipedia
14
+ license: cc-by-sa-3.0
15
+ task_categories:
16
+ - text-generation
17
+ - text-classification
18
+ - question-answering
19
+ ---