Datasets:
Languages:
Portuguese
License:
Update NURC-SP_Corpus_Minimo.py
Browse files- NURC-SP_Corpus_Minimo.py +11 -0
NURC-SP_Corpus_Minimo.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import csv
|
2 |
import datasets
|
3 |
from datasets import BuilderConfig, GeneratorBasedBuilder, DatasetInfo, SplitGenerator, Split
|
|
|
4 |
|
5 |
|
6 |
|
@@ -53,6 +54,16 @@ class NurcSPDataset(GeneratorBasedBuilder):
|
|
53 |
|
54 |
print("prompts_path:", prompts_path)
|
55 |
print("archive['train']:", archive["train"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
return [
|
58 |
SplitGenerator(
|
|
|
1 |
import csv
|
2 |
import datasets
|
3 |
from datasets import BuilderConfig, GeneratorBasedBuilder, DatasetInfo, SplitGenerator, Split
|
4 |
+
import tarfile
|
5 |
|
6 |
|
7 |
|
|
|
54 |
|
55 |
print("prompts_path:", prompts_path)
|
56 |
print("archive['train']:", archive["train"])
|
57 |
+
|
58 |
+
with open(prompts_path["train"], "r") as f:
|
59 |
+
csv_reader = csv.DictReader(f)
|
60 |
+
first_row = next(csv_reader) # Get the first row
|
61 |
+
print("First row in CSV:", first_row)
|
62 |
+
|
63 |
+
|
64 |
+
with tarfile.open(archive["train"], "r:gz") as tar:
|
65 |
+
tar.list() # List contents of the archive
|
66 |
+
|
67 |
|
68 |
return [
|
69 |
SplitGenerator(
|