-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
12,327 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
custom_ner_model29+23.4-1git | ||
custom_ner_model30git |
1 change: 1 addition & 0 deletions
1
machine-learn/scrape_data/level0/Gemini-synthetic-v2/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
song-tags-output/ |
28 changes: 28 additions & 0 deletions
28
machine-learn/scrape_data/level0/Gemini-synthetic-v2/2.1merge_jsons.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import json | ||
import glob | ||
import zipfile | ||
|
||
# הגדר תיקייה | ||
zip_folder = "song-tags-output" # תיקייה שבה נמצאים קבצי ה-ZIP | ||
output_file = "tagged_songs.json" # שם קובץ JSON הממוזג | ||
|
||
# רשימה לאחסון הנתונים מכל הקבצים | ||
merged_data = [] | ||
|
||
# קריאת כל קבצי ZIP בתיקייה | ||
for zip_path in glob.glob(f"{zip_folder}/*.zip"): | ||
with zipfile.ZipFile(zip_path, 'r') as zip_ref: | ||
# מציאת כל הקבצים עם סיומת .json בתוך קובץ ה-ZIP | ||
json_files = [f for f in zip_ref.namelist() if f.endswith('.json')] | ||
for json_file in json_files: | ||
# קריאת תוכן קובץ JSON ישירות מתוך ה-ZIP | ||
with zip_ref.open(json_file) as f: | ||
data = json.load(f) | ||
merged_data.extend(data) # הוספת הנתונים לרשימה הממוזגת | ||
|
||
# כתיבת הנתונים הממוזגים לקובץ JSON חדש | ||
with open(output_file, 'w', encoding='utf-8') as f: | ||
json.dump(merged_data, f, ensure_ascii=False, indent=4) | ||
|
||
# הודעה על הצלחה | ||
print(f"כל הנתונים מקבצי ה-ZIP מוזגו לקובץ {output_file}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.