Add use cases and universal index idea
Browse files- List_of_the_Most_Common_English_Words_70320cde.json.gz +3 -0
- README.md +20 -2
- create_meta_data_csv_md.ipynb +185 -0
- meta_data.csv +3 -0
- meta_data.md +3 -0
List_of_the_Most_Common_English_Words_70320cde.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6528cabf6678c5a9afab25ad56e6ca4131e6b1381b8455865677d2453159f151
|
3 |
+
size 16373377
|
README.md
CHANGED
@@ -20,9 +20,9 @@ tags:
|
|
20 |
This is the HF data repo for indexed texts, ready-to-import in SemanticFinder. The files contain the original text, text chunks and their embeddings.
|
21 |
|
22 |
### Catalogue
|
23 |
-
|
24 |
| filesize | textTitle | textAuthor | textYear | textLanguage | URL | modelName | quantized | splitParam | splitType | characters | chunks | wordsToAvoidAll | wordsToCheckAll | wordsToAvoidAny | wordsToCheckAny | exportDecimals | lines | textNotes | textSourceURL | filename |
|
25 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
|
26 |
| 4.78 | Das Kapital | Karl Marx | 1867 | de | https://do-me.github.io/SemanticFinder/?hf=Das_Kapital_c1a84fba | Xenova/multilingual-e5-small | True | 80 | Words | 2003807 | 3164 | | | | | 5 | 28673 | | https://ia601605.us.archive.org/13/items/KarlMarxDasKapitalpdf/KAPITAL1.pdf | Das_Kapital_c1a84fba.json.gz |
|
27 |
| 2.58 | Divina Commedia | Dante | 1321 | it | https://do-me.github.io/SemanticFinder/?hf=Divina_Commedia_d5a0fa67 | Xenova/multilingual-e5-base | True | 50 | Words | 383782 | 1179 | | | | | 5 | 6225 | | http://www.letteratura-italiana.com/pdf/divina%20commedia/08%20Inferno%20in%20versione%20italiana.pdf | Divina_Commedia_d5a0fa67.json.gz |
|
28 |
| 11.92 | Don Quijote | Miguel de Cervantes | 1605 | es | https://do-me.github.io/SemanticFinder/?hf=Don_Quijote_14a0b44 | Xenova/multilingual-e5-base | True | 25 | Words | 1047150 | 7186 | | | | | 4 | 12005 | | https://parnaseo.uv.es/lemir/revista/revista19/textos/quijote_1.pdf | Don_Quijote_14a0b44.json.gz |
|
@@ -32,6 +32,8 @@ This is the HF data repo for indexed texts, ready-to-import in SemanticFinder. T
|
|
32 |
| 25.56 | King James Bible | | None | en | https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_24f6dc4c | TaylorAI/gte-tiny | True | 200 | Chars | 4556163 | 23056 | | | | | 5 | 80496 | | https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf | King_James_Bible_24f6dc4c.json.gz |
|
33 |
| 11.45 | King James Bible | | None | en | https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_6434a78d | TaylorAI/gte-tiny | True | 200 | Chars | 4556163 | 23056 | | | | | 2 | 80496 | | https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf | King_James_Bible_6434a78d.json.gz |
|
34 |
| 39.32 | Les Misérables | Victor Hugo | 1862 | fr | https://do-me.github.io/SemanticFinder/?hf=Les_Misérables_2239df51 | Xenova/multilingual-e5-base | True | 25 | Words | 3236941 | 19463 | | | | | 5 | 74491 | All five acts included | https://beq.ebooksgratuits.com/vents/Hugo-miserables-1.pdf | Les_Misérables_2239df51.json.gz |
|
|
|
|
|
35 |
| 0.46 | REGULATION (EU) 2023/138 | European Commission | 2022 | en | https://do-me.github.io/SemanticFinder/?hf=REGULATION_(EU)_2023_138_c00e7ff6 | Supabase/bge-small-en | True | 25 | Words | 76809 | 424 | | | | | 5 | 1323 | | https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32023R0138&qid=1704492501351 | REGULATION_(EU)_2023_138_c00e7ff6.json.gz |
|
36 |
| 0.07 | Universal Declaration of Human Rights | United Nations | 1948 | en | https://do-me.github.io/SemanticFinder/?hf=Universal_Declaration_of_Human_Rights_0a7da79a | TaylorAI/gte-tiny | True | \nArticle | Regex | 8623 | 63 | | | | | 5 | 109 | 30 articles | https://www.un.org/en/about-us/universal-declaration-of-human-rights | Universal_Declaration_of_Human_Rights_0a7da79a.json.gz |
|
37 |
|
@@ -50,4 +52,20 @@ Once loaded in SemanticFinder it takes around 2 seconds to search through the wh
|
|
50 |
### Privacy
|
51 |
- This repo is public and shares documents of public interest or documents in the public domain.
|
52 |
- If you have sensitive documents you can still create the index with SemanticFinder and use it only locally.
|
53 |
-
Either you can load the index from disk each time or you host it in your local network and add the URL in SemanticFinder.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
This is the HF data repo for indexed texts, ready-to-import in SemanticFinder. The files contain the original text, text chunks and their embeddings.
|
21 |
|
22 |
### Catalogue
|
|
|
23 |
| filesize | textTitle | textAuthor | textYear | textLanguage | URL | modelName | quantized | splitParam | splitType | characters | chunks | wordsToAvoidAll | wordsToCheckAll | wordsToAvoidAny | wordsToCheckAny | exportDecimals | lines | textNotes | textSourceURL | filename |
|
24 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
25 |
+
| 100.96 | Collection of 100 books | Various Authors | 1890 | en | https://do-me.github.io/SemanticFinder/?hf=Collection_of_100_books_dd80b04b | Xenova/bge-small-en-v1.5 | True | 100 | Words | 55705582 | 158957 | | | | | 2 | 1085035 | US Public Domain Books (English) | https://huggingface.co/datasets/storytracer/US-PD-Books/tree/main/data | Collection_of_100_books_dd80b04b.json.gz |
|
26 |
| 4.78 | Das Kapital | Karl Marx | 1867 | de | https://do-me.github.io/SemanticFinder/?hf=Das_Kapital_c1a84fba | Xenova/multilingual-e5-small | True | 80 | Words | 2003807 | 3164 | | | | | 5 | 28673 | | https://ia601605.us.archive.org/13/items/KarlMarxDasKapitalpdf/KAPITAL1.pdf | Das_Kapital_c1a84fba.json.gz |
|
27 |
| 2.58 | Divina Commedia | Dante | 1321 | it | https://do-me.github.io/SemanticFinder/?hf=Divina_Commedia_d5a0fa67 | Xenova/multilingual-e5-base | True | 50 | Words | 383782 | 1179 | | | | | 5 | 6225 | | http://www.letteratura-italiana.com/pdf/divina%20commedia/08%20Inferno%20in%20versione%20italiana.pdf | Divina_Commedia_d5a0fa67.json.gz |
|
28 |
| 11.92 | Don Quijote | Miguel de Cervantes | 1605 | es | https://do-me.github.io/SemanticFinder/?hf=Don_Quijote_14a0b44 | Xenova/multilingual-e5-base | True | 25 | Words | 1047150 | 7186 | | | | | 4 | 12005 | | https://parnaseo.uv.es/lemir/revista/revista19/textos/quijote_1.pdf | Don_Quijote_14a0b44.json.gz |
|
|
|
32 |
| 25.56 | King James Bible | | None | en | https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_24f6dc4c | TaylorAI/gte-tiny | True | 200 | Chars | 4556163 | 23056 | | | | | 5 | 80496 | | https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf | King_James_Bible_24f6dc4c.json.gz |
|
33 |
| 11.45 | King James Bible | | None | en | https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_6434a78d | TaylorAI/gte-tiny | True | 200 | Chars | 4556163 | 23056 | | | | | 2 | 80496 | | https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf | King_James_Bible_6434a78d.json.gz |
|
34 |
| 39.32 | Les Misérables | Victor Hugo | 1862 | fr | https://do-me.github.io/SemanticFinder/?hf=Les_Misérables_2239df51 | Xenova/multilingual-e5-base | True | 25 | Words | 3236941 | 19463 | | | | | 5 | 74491 | All five acts included | https://beq.ebooksgratuits.com/vents/Hugo-miserables-1.pdf | Les_Misérables_2239df51.json.gz |
|
35 |
+
| 8.67 | List of the Most Common English Words | Dolph | 2012 | en | https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_0d1e28dc | Xenova/bge-small-en-v1.5 | True | \n | Regex | 210518 | 25322 | | | | | 2 | 25323 | GitHub Repo | https://raw.githubusercontent.com/dolph/dictionary/master/popular.txt | List_of_the_Most_Common_English_Words_0d1e28dc.json.gz |
|
36 |
+
| 15.61 | List of the Most Common English Words | Dolph | 2012 | en | https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_70320cde | Xenova/multilingual-e5-base | True | \n | Regex | 210518 | 25322 | | | | | 2 | 25323 | GitHub Repo | https://raw.githubusercontent.com/dolph/dictionary/master/popular.txt | List_of_the_Most_Common_English_Words_70320cde.json.gz |
|
37 |
| 0.46 | REGULATION (EU) 2023/138 | European Commission | 2022 | en | https://do-me.github.io/SemanticFinder/?hf=REGULATION_(EU)_2023_138_c00e7ff6 | Supabase/bge-small-en | True | 25 | Words | 76809 | 424 | | | | | 5 | 1323 | | https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32023R0138&qid=1704492501351 | REGULATION_(EU)_2023_138_c00e7ff6.json.gz |
|
38 |
| 0.07 | Universal Declaration of Human Rights | United Nations | 1948 | en | https://do-me.github.io/SemanticFinder/?hf=Universal_Declaration_of_Human_Rights_0a7da79a | TaylorAI/gte-tiny | True | \nArticle | Regex | 8623 | 63 | | | | | 5 | 109 | 30 articles | https://www.un.org/en/about-us/universal-declaration-of-human-rights | Universal_Declaration_of_Human_Rights_0a7da79a.json.gz |
|
39 |
|
|
|
52 |
### Privacy
|
53 |
- This repo is public and shares documents of public interest or documents in the public domain.
|
54 |
- If you have sensitive documents you can still create the index with SemanticFinder and use it only locally.
|
55 |
+
Either you can load the index from disk each time or you host it in your local network and add the URL in SemanticFinder.
|
56 |
+
|
57 |
+
### Use cases
|
58 |
+
#### Standard use case
|
59 |
+
Search for most similar words/sentences/paragraphs/pages in any text. Just imagine CTRL+F could find related words and not only the exact same one you used!
|
60 |
+
If you're working on the same text repeatedly you can save the index and reuse it.
|
61 |
+
|
62 |
+
Also, there is the option of summarizing the results with generative AI like Qwen models right in your browser or connecting a heavy Llama2 instance with Ollama.
|
63 |
+
|
64 |
+
#### Advanced use cases
|
65 |
+
- [Translate words with multilingual embeddings](https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_70320cde&firstOnly=true&inferencingActive=False) or see which words out of a given list are most similar to your input word. Using e.g. the index of ~30k English words you can use more than 100 input languages to query! Note that here the expert settings change so that only the first match is displayed.
|
66 |
+
- [English synonym finder](https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_0d1e28dc&firstOnly=true&inferencingActive=False), using again the index of ~30k English words but with slightly better (and smaller) English-only embeddings. Same expert settings here.
|
67 |
+
- The [universal index idea](https://github.com/do-me/SemanticFinder/discussions/48), i.e. use the 30k English words index and do not inference for any new words. In this way you can perform **instant** semantic search on unknown / unseen / not indexed texts! Use [this URL](https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_0d1e28dc&inferencingActive=False) and add then copy and paste any text of your choice into the text field. Inferencing any new words is turned off for speed gains.
|
68 |
+
- A hybrid version of the universal index where you use the 30k English words as start index but then "fill up" with all the additional words the index doesn't know yet. For this option just use [this URL](https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_0d1e28dc&inferencingActive=True) where the inferencing is turned on again. This yields best results and might be a good compromise assuming that new texts generally don't have that many new words. Even if it's a couple of hundreds (like in a particular research paper in a niche domain) inferencing is quite fast.
|
69 |
+
|
70 |
+
## If you have any feedback/ideas/feature requests please open an issue or create a PR in the GitHub repo.
|
71 |
+
## ⭐Stars very welcome to spread the word and democratize semantic search!⭐
|
create_meta_data_csv_md.ipynb
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"## ⚠️ For now, do not use this script as there is one minor problem! ⚠️\n",
|
8 |
+
"### Instead just run `create_meta_data_csv_md.py` once and copy & paste the entire content of `meta_data.md` between `### Catalogue` and `### Example`.\n",
|
9 |
+
"\n",
|
10 |
+
"This is a jupyter notebook with two cells/scripts. However, both have the same flaw: `\\n` new line handling is messy as the table does contain entries like `...| test | \\nArticle | test data | ...` that are parsed as line breaks destroying the markdown table. \n",
|
11 |
+
"\n",
|
12 |
+
"If you read this and have a quick solution, please share it! I'm currently working on other features and don't have time to investigate further."
|
13 |
+
]
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"cell_type": "markdown",
|
17 |
+
"metadata": {},
|
18 |
+
"source": [
|
19 |
+
"### 1) Read the meta_data file and update readme"
|
20 |
+
]
|
21 |
+
},
|
22 |
+
{
|
23 |
+
"cell_type": "code",
|
24 |
+
"execution_count": 3,
|
25 |
+
"metadata": {},
|
26 |
+
"outputs": [],
|
27 |
+
"source": [
|
28 |
+
"import re\n",
|
29 |
+
"\n",
|
30 |
+
"def update_readme_with_metadata(readme_path='README.md', metadata_path='meta_data.md'):\n",
|
31 |
+
" # Step 1: Read the readme.md file\n",
|
32 |
+
" with open(readme_path, 'r') as file:\n",
|
33 |
+
" readme_content = file.read()\n",
|
34 |
+
" \n",
|
35 |
+
" # Step 2: Identify the section to replace\n",
|
36 |
+
" pattern = r\"### Catalogue(.*?)### Example\"\n",
|
37 |
+
" match = re.search(pattern, readme_content, re.DOTALL)\n",
|
38 |
+
" \n",
|
39 |
+
" if match:\n",
|
40 |
+
" # Step 3: Read the metadata.md file\n",
|
41 |
+
" with open(metadata_path, 'r') as file:\n",
|
42 |
+
" metadata_content = file.read()\n",
|
43 |
+
" \n",
|
44 |
+
" # Step 4: Replace the section\n",
|
45 |
+
" updated_content = re.sub(pattern, f\"### Catalogue\\n{metadata_content}\\n### Example\", readme_content, flags=re.DOTALL)\n",
|
46 |
+
" \n",
|
47 |
+
" # Step 5: Write the updated content back to readme.md\n",
|
48 |
+
" with open(readme_path, 'w') as file:\n",
|
49 |
+
" file.write(updated_content)\n",
|
50 |
+
" else:\n",
|
51 |
+
" print(\"The specified section was not found in the readme.md file.\")\n",
|
52 |
+
"\n",
|
53 |
+
"# Call the function\n",
|
54 |
+
"update_readme_with_metadata()\n"
|
55 |
+
]
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"cell_type": "markdown",
|
59 |
+
"metadata": {},
|
60 |
+
"source": [
|
61 |
+
"### 2) Do everything in one go: parse all json.gz files, create the meta_data file and update readme. Note that this cell might not run in Jupyter due to multiprocessing issues with ipykernel. "
|
62 |
+
]
|
63 |
+
},
|
64 |
+
{
|
65 |
+
"cell_type": "code",
|
66 |
+
"execution_count": 11,
|
67 |
+
"metadata": {},
|
68 |
+
"outputs": [],
|
69 |
+
"source": [
|
70 |
+
"import os\n",
|
71 |
+
"import json\n",
|
72 |
+
"import gzip\n",
|
73 |
+
"import csv\n",
|
74 |
+
"from multiprocessing import Pool, cpu_count\n",
|
75 |
+
"import time\n",
|
76 |
+
"\n",
|
77 |
+
"def process_json_file(file_path):\n",
|
78 |
+
" with gzip.open(file_path, 'rt', encoding='utf-8') as gz_file:\n",
|
79 |
+
" data = json.load(gz_file)\n",
|
80 |
+
" return data.get('meta', {})\n",
|
81 |
+
"\n",
|
82 |
+
"def get_file_size_mb(file_path):\n",
|
83 |
+
" return round(os.path.getsize(file_path) / (1024 * 1024), 2)\n",
|
84 |
+
"\n",
|
85 |
+
"def write_to_csv_and_md(output_csv, output_md, headers, data):\n",
|
86 |
+
" with open(output_csv, 'w', newline='', encoding='utf-8') as csv_file:\n",
|
87 |
+
" writer = csv.DictWriter(csv_file, fieldnames=headers)\n",
|
88 |
+
" writer.writeheader()\n",
|
89 |
+
" writer.writerows(data)\n",
|
90 |
+
"\n",
|
91 |
+
" with open(output_md, 'w', encoding='utf-8') as md_file:\n",
|
92 |
+
" md_file.write(\"| \" + \" | \".join(headers) + \" |\\n\")\n",
|
93 |
+
" md_file.write(\"|\" + \"|\".join([\" --- \" for _ in headers]) + \"|\\n\")\n",
|
94 |
+
"\n",
|
95 |
+
" for row in data:\n",
|
96 |
+
" md_file.write(\"| \" + \" | \".join([str(row[header]) for header in headers]) + \" |\\n\")\n",
|
97 |
+
"\n",
|
98 |
+
"def process_file(file_name, input_directory, base_url):\n",
|
99 |
+
" file_path = os.path.join(input_directory, file_name)\n",
|
100 |
+
" meta_data = process_json_file(file_path)\n",
|
101 |
+
" file_size_mb = get_file_size_mb(file_path)\n",
|
102 |
+
"\n",
|
103 |
+
" row_data = {\n",
|
104 |
+
" \"filesize\": file_size_mb,\n",
|
105 |
+
" \"filename\": file_name,\n",
|
106 |
+
" \"URL\": f\"{base_url}{file_name.replace('.json.gz', '')}\",\n",
|
107 |
+
" **meta_data\n",
|
108 |
+
" }\n",
|
109 |
+
"\n",
|
110 |
+
" return row_data\n",
|
111 |
+
"\n",
|
112 |
+
"def replace_section_in_readme(readme_path, meta_data_path):\n",
|
113 |
+
" # Read README.md content\n",
|
114 |
+
" with open(readme_path, 'r', encoding='utf-8') as readme_file:\n",
|
115 |
+
" readme_content = readme_file.read()\n",
|
116 |
+
" \n",
|
117 |
+
" # Read meta_data.md content\n",
|
118 |
+
" with open(meta_data_path, 'r', encoding='utf-8') as meta_data_file:\n",
|
119 |
+
" meta_data_content = meta_data_file.read()\n",
|
120 |
+
" \n",
|
121 |
+
" # Pattern to identify the section to replace\n",
|
122 |
+
" pattern = r\"### Catalogue(.*?)### Example\"\n",
|
123 |
+
" # Use re.sub to replace the section with meta_data_content\n",
|
124 |
+
" updated_readme_content = re.sub(pattern, f\"### Catalogue{meta_data_content}### Example\", readme_content, flags=re.DOTALL)\n",
|
125 |
+
" \n",
|
126 |
+
" # Write the updated content back to README.md\n",
|
127 |
+
" with open(readme_path, 'w', encoding='utf-8') as readme_file:\n",
|
128 |
+
" readme_file.write(updated_readme_content)\n",
|
129 |
+
"\n",
|
130 |
+
"def main(input_directory, output_csv, output_md, base_url=\"https://do-me.github.io/SemanticFinder/?hf=\"):\n",
|
131 |
+
" headers = [\n",
|
132 |
+
" \"filesize\", \"textTitle\", \"textAuthor\", \"textYear\", \"textLanguage\", \"URL\",\n",
|
133 |
+
" \"modelName\", \"quantized\", \"splitParam\", \"splitType\", \"characters\", \"chunks\",\n",
|
134 |
+
" \"wordsToAvoidAll\", \"wordsToCheckAll\", \"wordsToAvoidAny\", \"wordsToCheckAny\",\n",
|
135 |
+
" \"exportDecimals\", \"lines\", \"textNotes\", \"textSourceURL\", \"filename\"\n",
|
136 |
+
" ]\n",
|
137 |
+
"\n",
|
138 |
+
" all_data = []\n",
|
139 |
+
" \n",
|
140 |
+
" start_time = time.time()\n",
|
141 |
+
"\n",
|
142 |
+
" file_list = [file_name for file_name in os.listdir(input_directory) if file_name.endswith('.json.gz')]\n",
|
143 |
+
"\n",
|
144 |
+
" with Pool(cpu_count()) as pool:\n",
|
145 |
+
" all_data = pool.starmap(process_file, [(file_name, input_directory, base_url) for file_name in file_list])\n",
|
146 |
+
"\n",
|
147 |
+
" write_to_csv_and_md(output_csv, output_md, headers, all_data)\n",
|
148 |
+
" \n",
|
149 |
+
" replace_section_in_readme(os.path.join(input_directory, 'README.md'), os.path.join(input_directory, output_md))\n",
|
150 |
+
"\n",
|
151 |
+
" end_time = time.time()\n",
|
152 |
+
" processing_time = end_time - start_time\n",
|
153 |
+
" print(f\"Processing time: {round(processing_time, 2)} seconds\")\n",
|
154 |
+
"\n",
|
155 |
+
"if __name__ == \"__main__\":\n",
|
156 |
+
" input_directory = \".\"\n",
|
157 |
+
" output_csv = \"meta_data.csv\"\n",
|
158 |
+
" output_md = \"meta_data.md\"\n",
|
159 |
+
"\n",
|
160 |
+
" main(input_directory, output_csv, output_md)\n"
|
161 |
+
]
|
162 |
+
}
|
163 |
+
],
|
164 |
+
"metadata": {
|
165 |
+
"kernelspec": {
|
166 |
+
"display_name": "py3.11",
|
167 |
+
"language": "python",
|
168 |
+
"name": "python3"
|
169 |
+
},
|
170 |
+
"language_info": {
|
171 |
+
"codemirror_mode": {
|
172 |
+
"name": "ipython",
|
173 |
+
"version": 3
|
174 |
+
},
|
175 |
+
"file_extension": ".py",
|
176 |
+
"mimetype": "text/x-python",
|
177 |
+
"name": "python",
|
178 |
+
"nbconvert_exporter": "python",
|
179 |
+
"pygments_lexer": "ipython3",
|
180 |
+
"version": "3.11.0"
|
181 |
+
}
|
182 |
+
},
|
183 |
+
"nbformat": 4,
|
184 |
+
"nbformat_minor": 2
|
185 |
+
}
|
meta_data.csv
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
filesize,textTitle,textAuthor,textYear,textLanguage,URL,modelName,quantized,splitParam,splitType,characters,chunks,wordsToAvoidAll,wordsToCheckAll,wordsToAvoidAny,wordsToCheckAny,exportDecimals,lines,textNotes,textSourceURL,filename
|
|
|
2 |
4.78,Das Kapital,Karl Marx,1867,de,https://do-me.github.io/SemanticFinder/?hf=Das_Kapital_c1a84fba,Xenova/multilingual-e5-small,True,80,Words,2003807,3164,,,,,5,28673,,https://ia601605.us.archive.org/13/items/KarlMarxDasKapitalpdf/KAPITAL1.pdf,Das_Kapital_c1a84fba.json.gz
|
3 |
2.58,Divina Commedia,Dante,1321,it,https://do-me.github.io/SemanticFinder/?hf=Divina_Commedia_d5a0fa67,Xenova/multilingual-e5-base,True,50,Words,383782,1179,,,,,5,6225,,http://www.letteratura-italiana.com/pdf/divina%20commedia/08%20Inferno%20in%20versione%20italiana.pdf,Divina_Commedia_d5a0fa67.json.gz
|
4 |
11.92,Don Quijote,Miguel de Cervantes,1605,es,https://do-me.github.io/SemanticFinder/?hf=Don_Quijote_14a0b44,Xenova/multilingual-e5-base,True,25,Words,1047150,7186,,,,,4,12005,,https://parnaseo.uv.es/lemir/revista/revista19/textos/quijote_1.pdf,Don_Quijote_14a0b44.json.gz
|
@@ -8,5 +9,7 @@ filesize,textTitle,textAuthor,textYear,textLanguage,URL,modelName,quantized,spli
|
|
8 |
25.56,King James Bible,,,en,https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_24f6dc4c,TaylorAI/gte-tiny,True,200,Chars,4556163,23056,,,,,5,80496,,https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf,King_James_Bible_24f6dc4c.json.gz
|
9 |
11.45,King James Bible,,,en,https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_6434a78d,TaylorAI/gte-tiny,True,200,Chars,4556163,23056,,,,,2,80496,,https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf,King_James_Bible_6434a78d.json.gz
|
10 |
39.32,Les Misérables,Victor Hugo,1862,fr,https://do-me.github.io/SemanticFinder/?hf=Les_Misérables_2239df51,Xenova/multilingual-e5-base,True,25,Words,3236941,19463,,,,,5,74491,All five acts included,https://beq.ebooksgratuits.com/vents/Hugo-miserables-1.pdf,Les_Misérables_2239df51.json.gz
|
|
|
|
|
11 |
0.46,REGULATION (EU) 2023/138,European Commission,2022,en,https://do-me.github.io/SemanticFinder/?hf=REGULATION_(EU)_2023_138_c00e7ff6,Supabase/bge-small-en,True,25,Words,76809,424,,,,,5,1323,,https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32023R0138&qid=1704492501351,REGULATION_(EU)_2023_138_c00e7ff6.json.gz
|
12 |
0.07,Universal Declaration of Human Rights,United Nations,1948,en,https://do-me.github.io/SemanticFinder/?hf=Universal_Declaration_of_Human_Rights_0a7da79a,TaylorAI/gte-tiny,True,\nArticle ,Regex,8623,63,,,,,5,109,30 articles,https://www.un.org/en/about-us/universal-declaration-of-human-rights,Universal_Declaration_of_Human_Rights_0a7da79a.json.gz
|
|
|
1 |
filesize,textTitle,textAuthor,textYear,textLanguage,URL,modelName,quantized,splitParam,splitType,characters,chunks,wordsToAvoidAll,wordsToCheckAll,wordsToAvoidAny,wordsToCheckAny,exportDecimals,lines,textNotes,textSourceURL,filename
|
2 |
+
100.96,Collection of 100 books,Various Authors,1890,en,https://do-me.github.io/SemanticFinder/?hf=Collection_of_100_books_dd80b04b,Xenova/bge-small-en-v1.5,True,100,Words,55705582,158957,,,,,2,1085035,US Public Domain Books (English),https://huggingface.co/datasets/storytracer/US-PD-Books/tree/main/data,Collection_of_100_books_dd80b04b.json.gz
|
3 |
4.78,Das Kapital,Karl Marx,1867,de,https://do-me.github.io/SemanticFinder/?hf=Das_Kapital_c1a84fba,Xenova/multilingual-e5-small,True,80,Words,2003807,3164,,,,,5,28673,,https://ia601605.us.archive.org/13/items/KarlMarxDasKapitalpdf/KAPITAL1.pdf,Das_Kapital_c1a84fba.json.gz
|
4 |
2.58,Divina Commedia,Dante,1321,it,https://do-me.github.io/SemanticFinder/?hf=Divina_Commedia_d5a0fa67,Xenova/multilingual-e5-base,True,50,Words,383782,1179,,,,,5,6225,,http://www.letteratura-italiana.com/pdf/divina%20commedia/08%20Inferno%20in%20versione%20italiana.pdf,Divina_Commedia_d5a0fa67.json.gz
|
5 |
11.92,Don Quijote,Miguel de Cervantes,1605,es,https://do-me.github.io/SemanticFinder/?hf=Don_Quijote_14a0b44,Xenova/multilingual-e5-base,True,25,Words,1047150,7186,,,,,4,12005,,https://parnaseo.uv.es/lemir/revista/revista19/textos/quijote_1.pdf,Don_Quijote_14a0b44.json.gz
|
|
|
9 |
25.56,King James Bible,,,en,https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_24f6dc4c,TaylorAI/gte-tiny,True,200,Chars,4556163,23056,,,,,5,80496,,https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf,King_James_Bible_24f6dc4c.json.gz
|
10 |
11.45,King James Bible,,,en,https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_6434a78d,TaylorAI/gte-tiny,True,200,Chars,4556163,23056,,,,,2,80496,,https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf,King_James_Bible_6434a78d.json.gz
|
11 |
39.32,Les Misérables,Victor Hugo,1862,fr,https://do-me.github.io/SemanticFinder/?hf=Les_Misérables_2239df51,Xenova/multilingual-e5-base,True,25,Words,3236941,19463,,,,,5,74491,All five acts included,https://beq.ebooksgratuits.com/vents/Hugo-miserables-1.pdf,Les_Misérables_2239df51.json.gz
|
12 |
+
8.67,List of the Most Common English Words,Dolph,2012,en,https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_0d1e28dc,Xenova/bge-small-en-v1.5,True,\n,Regex,210518,25322,,,,,2,25323,GitHub Repo,https://raw.githubusercontent.com/dolph/dictionary/master/popular.txt,List_of_the_Most_Common_English_Words_0d1e28dc.json.gz
|
13 |
+
15.61,List of the Most Common English Words,Dolph,2012,en,https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_70320cde,Xenova/multilingual-e5-base,True,\n,Regex,210518,25322,,,,,2,25323,GitHub Repo,https://raw.githubusercontent.com/dolph/dictionary/master/popular.txt,List_of_the_Most_Common_English_Words_70320cde.json.gz
|
14 |
0.46,REGULATION (EU) 2023/138,European Commission,2022,en,https://do-me.github.io/SemanticFinder/?hf=REGULATION_(EU)_2023_138_c00e7ff6,Supabase/bge-small-en,True,25,Words,76809,424,,,,,5,1323,,https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32023R0138&qid=1704492501351,REGULATION_(EU)_2023_138_c00e7ff6.json.gz
|
15 |
0.07,Universal Declaration of Human Rights,United Nations,1948,en,https://do-me.github.io/SemanticFinder/?hf=Universal_Declaration_of_Human_Rights_0a7da79a,TaylorAI/gte-tiny,True,\nArticle ,Regex,8623,63,,,,,5,109,30 articles,https://www.un.org/en/about-us/universal-declaration-of-human-rights,Universal_Declaration_of_Human_Rights_0a7da79a.json.gz
|
meta_data.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
| filesize | textTitle | textAuthor | textYear | textLanguage | URL | modelName | quantized | splitParam | splitType | characters | chunks | wordsToAvoidAll | wordsToCheckAll | wordsToAvoidAny | wordsToCheckAny | exportDecimals | lines | textNotes | textSourceURL | filename |
|
2 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
|
3 |
| 4.78 | Das Kapital | Karl Marx | 1867 | de | https://do-me.github.io/SemanticFinder/?hf=Das_Kapital_c1a84fba | Xenova/multilingual-e5-small | True | 80 | Words | 2003807 | 3164 | | | | | 5 | 28673 | | https://ia601605.us.archive.org/13/items/KarlMarxDasKapitalpdf/KAPITAL1.pdf | Das_Kapital_c1a84fba.json.gz |
|
4 |
| 2.58 | Divina Commedia | Dante | 1321 | it | https://do-me.github.io/SemanticFinder/?hf=Divina_Commedia_d5a0fa67 | Xenova/multilingual-e5-base | True | 50 | Words | 383782 | 1179 | | | | | 5 | 6225 | | http://www.letteratura-italiana.com/pdf/divina%20commedia/08%20Inferno%20in%20versione%20italiana.pdf | Divina_Commedia_d5a0fa67.json.gz |
|
5 |
| 11.92 | Don Quijote | Miguel de Cervantes | 1605 | es | https://do-me.github.io/SemanticFinder/?hf=Don_Quijote_14a0b44 | Xenova/multilingual-e5-base | True | 25 | Words | 1047150 | 7186 | | | | | 4 | 12005 | | https://parnaseo.uv.es/lemir/revista/revista19/textos/quijote_1.pdf | Don_Quijote_14a0b44.json.gz |
|
@@ -9,5 +10,7 @@
|
|
9 |
| 25.56 | King James Bible | | None | en | https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_24f6dc4c | TaylorAI/gte-tiny | True | 200 | Chars | 4556163 | 23056 | | | | | 5 | 80496 | | https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf | King_James_Bible_24f6dc4c.json.gz |
|
10 |
| 11.45 | King James Bible | | None | en | https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_6434a78d | TaylorAI/gte-tiny | True | 200 | Chars | 4556163 | 23056 | | | | | 2 | 80496 | | https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf | King_James_Bible_6434a78d.json.gz |
|
11 |
| 39.32 | Les Misérables | Victor Hugo | 1862 | fr | https://do-me.github.io/SemanticFinder/?hf=Les_Misérables_2239df51 | Xenova/multilingual-e5-base | True | 25 | Words | 3236941 | 19463 | | | | | 5 | 74491 | All five acts included | https://beq.ebooksgratuits.com/vents/Hugo-miserables-1.pdf | Les_Misérables_2239df51.json.gz |
|
|
|
|
|
12 |
| 0.46 | REGULATION (EU) 2023/138 | European Commission | 2022 | en | https://do-me.github.io/SemanticFinder/?hf=REGULATION_(EU)_2023_138_c00e7ff6 | Supabase/bge-small-en | True | 25 | Words | 76809 | 424 | | | | | 5 | 1323 | | https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32023R0138&qid=1704492501351 | REGULATION_(EU)_2023_138_c00e7ff6.json.gz |
|
13 |
| 0.07 | Universal Declaration of Human Rights | United Nations | 1948 | en | https://do-me.github.io/SemanticFinder/?hf=Universal_Declaration_of_Human_Rights_0a7da79a | TaylorAI/gte-tiny | True | \nArticle | Regex | 8623 | 63 | | | | | 5 | 109 | 30 articles | https://www.un.org/en/about-us/universal-declaration-of-human-rights | Universal_Declaration_of_Human_Rights_0a7da79a.json.gz |
|
|
|
1 |
| filesize | textTitle | textAuthor | textYear | textLanguage | URL | modelName | quantized | splitParam | splitType | characters | chunks | wordsToAvoidAll | wordsToCheckAll | wordsToAvoidAny | wordsToCheckAny | exportDecimals | lines | textNotes | textSourceURL | filename |
|
2 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
3 |
+
| 100.96 | Collection of 100 books | Various Authors | 1890 | en | https://do-me.github.io/SemanticFinder/?hf=Collection_of_100_books_dd80b04b | Xenova/bge-small-en-v1.5 | True | 100 | Words | 55705582 | 158957 | | | | | 2 | 1085035 | US Public Domain Books (English) | https://huggingface.co/datasets/storytracer/US-PD-Books/tree/main/data | Collection_of_100_books_dd80b04b.json.gz |
|
4 |
| 4.78 | Das Kapital | Karl Marx | 1867 | de | https://do-me.github.io/SemanticFinder/?hf=Das_Kapital_c1a84fba | Xenova/multilingual-e5-small | True | 80 | Words | 2003807 | 3164 | | | | | 5 | 28673 | | https://ia601605.us.archive.org/13/items/KarlMarxDasKapitalpdf/KAPITAL1.pdf | Das_Kapital_c1a84fba.json.gz |
|
5 |
| 2.58 | Divina Commedia | Dante | 1321 | it | https://do-me.github.io/SemanticFinder/?hf=Divina_Commedia_d5a0fa67 | Xenova/multilingual-e5-base | True | 50 | Words | 383782 | 1179 | | | | | 5 | 6225 | | http://www.letteratura-italiana.com/pdf/divina%20commedia/08%20Inferno%20in%20versione%20italiana.pdf | Divina_Commedia_d5a0fa67.json.gz |
|
6 |
| 11.92 | Don Quijote | Miguel de Cervantes | 1605 | es | https://do-me.github.io/SemanticFinder/?hf=Don_Quijote_14a0b44 | Xenova/multilingual-e5-base | True | 25 | Words | 1047150 | 7186 | | | | | 4 | 12005 | | https://parnaseo.uv.es/lemir/revista/revista19/textos/quijote_1.pdf | Don_Quijote_14a0b44.json.gz |
|
|
|
10 |
| 25.56 | King James Bible | | None | en | https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_24f6dc4c | TaylorAI/gte-tiny | True | 200 | Chars | 4556163 | 23056 | | | | | 5 | 80496 | | https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf | King_James_Bible_24f6dc4c.json.gz |
|
11 |
| 11.45 | King James Bible | | None | en | https://do-me.github.io/SemanticFinder/?hf=King_James_Bible_6434a78d | TaylorAI/gte-tiny | True | 200 | Chars | 4556163 | 23056 | | | | | 2 | 80496 | | https://www.holybooks.com/wp-content/uploads/2010/05/The-Holy-Bible-King-James-Version.pdf | King_James_Bible_6434a78d.json.gz |
|
12 |
| 39.32 | Les Misérables | Victor Hugo | 1862 | fr | https://do-me.github.io/SemanticFinder/?hf=Les_Misérables_2239df51 | Xenova/multilingual-e5-base | True | 25 | Words | 3236941 | 19463 | | | | | 5 | 74491 | All five acts included | https://beq.ebooksgratuits.com/vents/Hugo-miserables-1.pdf | Les_Misérables_2239df51.json.gz |
|
13 |
+
| 8.67 | List of the Most Common English Words | Dolph | 2012 | en | https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_0d1e28dc | Xenova/bge-small-en-v1.5 | True | \n | Regex | 210518 | 25322 | | | | | 2 | 25323 | GitHub Repo | https://raw.githubusercontent.com/dolph/dictionary/master/popular.txt | List_of_the_Most_Common_English_Words_0d1e28dc.json.gz |
|
14 |
+
| 15.61 | List of the Most Common English Words | Dolph | 2012 | en | https://do-me.github.io/SemanticFinder/?hf=List_of_the_Most_Common_English_Words_70320cde | Xenova/multilingual-e5-base | True | \n | Regex | 210518 | 25322 | | | | | 2 | 25323 | GitHub Repo | https://raw.githubusercontent.com/dolph/dictionary/master/popular.txt | List_of_the_Most_Common_English_Words_70320cde.json.gz |
|
15 |
| 0.46 | REGULATION (EU) 2023/138 | European Commission | 2022 | en | https://do-me.github.io/SemanticFinder/?hf=REGULATION_(EU)_2023_138_c00e7ff6 | Supabase/bge-small-en | True | 25 | Words | 76809 | 424 | | | | | 5 | 1323 | | https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32023R0138&qid=1704492501351 | REGULATION_(EU)_2023_138_c00e7ff6.json.gz |
|
16 |
| 0.07 | Universal Declaration of Human Rights | United Nations | 1948 | en | https://do-me.github.io/SemanticFinder/?hf=Universal_Declaration_of_Human_Rights_0a7da79a | TaylorAI/gte-tiny | True | \nArticle | Regex | 8623 | 63 | | | | | 5 | 109 | 30 articles | https://www.un.org/en/about-us/universal-declaration-of-human-rights | Universal_Declaration_of_Human_Rights_0a7da79a.json.gz |
|