Upload folder using huggingface_hub
Browse files- README.md +1 -0
- probes.jsonl +2 -2
- pyproject.toml +1 -1
- src/finesse_benchmark_database/chunker.py +8 -3
README.md
CHANGED
|
@@ -71,6 +71,7 @@ Example:
|
|
| 71 |
"source": {
|
| 72 |
"dataset": "wikimedia/wikipedia",
|
| 73 |
"article_id": "5438",
|
|
|
|
| 74 |
"lang": "en"
|
| 75 |
},
|
| 76 |
"beads": [
|
|
|
|
| 71 |
"source": {
|
| 72 |
"dataset": "wikimedia/wikipedia",
|
| 73 |
"article_id": "5438",
|
| 74 |
+
"source_article_hash": "...article_hash...",
|
| 75 |
"lang": "en"
|
| 76 |
},
|
| 77 |
"beads": [
|
probes.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:436cb790b33b8f878210dfd312ae7154c9dfe46c9c87e4fc8f9582b7f87f47ba
|
| 3 |
+
size 853994261
|
pyproject.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
[tool.poetry]
|
| 2 |
name = "finesse-benchmark-database"
|
| 3 |
-
version = "0.1.
|
| 4 |
description = "Data generation factory for atomic probes in Finesse benchmark. Generates probes_atomic.jsonl from Wikimedia Wikipedia."
|
| 5 |
authors = ["winter.sci.dev <enzoescipy@gmail.com>"]
|
| 6 |
readme = "README.md"
|
|
|
|
| 1 |
[tool.poetry]
|
| 2 |
name = "finesse-benchmark-database"
|
| 3 |
+
version = "0.1.14"
|
| 4 |
description = "Data generation factory for atomic probes in Finesse benchmark. Generates probes_atomic.jsonl from Wikimedia Wikipedia."
|
| 5 |
authors = ["winter.sci.dev <enzoescipy@gmail.com>"]
|
| 6 |
readme = "README.md"
|
src/finesse_benchmark_database/chunker.py
CHANGED
|
@@ -18,7 +18,7 @@ from chunker import generate_all_strings_of_beads
|
|
| 18 |
strings_of_beads = generate_all_strings_of_beads()
|
| 19 |
# Result: List[Dict] where each inner dict contains 'source' and 'beads' keys.
|
| 20 |
"""
|
| 21 |
-
|
| 22 |
import logging
|
| 23 |
import random
|
| 24 |
from typing import List, Dict
|
|
@@ -79,12 +79,15 @@ def generate_all_strings_of_beads(config: ProbeConfig) -> List[Dict]:
|
|
| 79 |
for example in dataset:
|
| 80 |
if len(strings_for_lang) >= config.samples_per_language:
|
| 81 |
break
|
| 82 |
-
|
| 83 |
# Extract and clean text
|
| 84 |
text = example.get("text", "").strip()
|
| 85 |
if not text:
|
| 86 |
continue
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
| 88 |
# Extract article ID for metadata
|
| 89 |
article_id = example.get("id", "")
|
| 90 |
|
|
@@ -104,10 +107,12 @@ def generate_all_strings_of_beads(config: ProbeConfig) -> List[Dict]:
|
|
| 104 |
|
| 105 |
# Only add the string if it has at least one bead
|
| 106 |
if beads:
|
|
|
|
| 107 |
string_data = {
|
| 108 |
"source": {
|
| 109 |
"dataset": "wikimedia/wikipedia",
|
| 110 |
"article_id": article_id,
|
|
|
|
| 111 |
"lang": lang
|
| 112 |
},
|
| 113 |
"beads": beads
|
|
|
|
| 18 |
strings_of_beads = generate_all_strings_of_beads()
|
| 19 |
# Result: List[Dict] where each inner dict contains 'source' and 'beads' keys.
|
| 20 |
"""
|
| 21 |
+
import hashlib
|
| 22 |
import logging
|
| 23 |
import random
|
| 24 |
from typing import List, Dict
|
|
|
|
| 79 |
for example in dataset:
|
| 80 |
if len(strings_for_lang) >= config.samples_per_language:
|
| 81 |
break
|
| 82 |
+
|
| 83 |
# Extract and clean text
|
| 84 |
text = example.get("text", "").strip()
|
| 85 |
if not text:
|
| 86 |
continue
|
| 87 |
+
|
| 88 |
+
# Compute article hash for deduplication
|
| 89 |
+
article_hash = hashlib.sha256(example.get("text", "").encode('utf-8')).hexdigest()
|
| 90 |
+
|
| 91 |
# Extract article ID for metadata
|
| 92 |
article_id = example.get("id", "")
|
| 93 |
|
|
|
|
| 107 |
|
| 108 |
# Only add the string if it has at least one bead
|
| 109 |
if beads:
|
| 110 |
+
|
| 111 |
string_data = {
|
| 112 |
"source": {
|
| 113 |
"dataset": "wikimedia/wikipedia",
|
| 114 |
"article_id": article_id,
|
| 115 |
+
"source_article_hash": article_hash,
|
| 116 |
"lang": lang
|
| 117 |
},
|
| 118 |
"beads": beads
|