המלצה | הצעה לתוסף: חיפוש פסקאות מקבילות וציטוטים
-
באשכול על רעיונות לתוספים העלתי הצעה לשלב כלי מקביל לשל דיקטה "כלי למציאת ציטוטים https://citation.dicta.org.il/
@ori-bensimon התכתב איתי ושלח את הבקשה להלל גרשוני, שיש לו כלי מקביל בתוכנה שלו המתעסקת בגניזה הקהירית.
יש כבר קוד שעובד, אבל צריך הרבה התאמות.
אני מעלה לך את ההתכתבות אם יעניין משהו (אני לא מבין מילה בקוד).בעצם מה הרעיון
כידוע יש המון הקבלות וכפלויות בראשונים.
תוס', תורא"ש תר"פ וכו'
וכן רמב"ן רשב"א ריטב"א וכו'
ועוד הרבה ראשונים שכותבים דברים מקבילים.
הרבה מלימוד עוסק המציאת והשוואת המקבילות ולראות אם יש תוספת חידוש בכל אחד.
מה שמאוד יעזר זה כלי שמנסה לחפש מקבילות בפסקאות.
אפשר להגדיר רמת דיוק (אחוז מילים מקבילות בפסקה) והוא יחפש פסקאות מקבילות.
אבל נראה לי שיש בעיה לעשות את זה אופליין.
אז אולי מה שצריך לעשות הוא להריץ את זה קודם על כל המאגר ואז לעלות איזה קידוד.או בנוסח אחר (כמו פורמט לAI)
אני מעונין בכלי שיחפש פסקאות לפי מידת הקבלתם. אני מעלה פסקה ואתה מוצא לי פסקה מקבילה לפי רמת הדיוק שאני מגדיר לך. רמת הדיוק היא כמות המילים המקבילות בין הפסקאות.
אני מעוניין בכלי אוטומטי שיכול לבחון ספריה שלימה ולהקביל אותה בתוך עצמה, ולאתר את הפסקאות המקבילות שבתוך הספריה.
יהיה ניתן להגדיר גם רמת דיוק משתנה עבור טקסטים.
למשל עבור פסוקים יהיה ניתן להגדיר שכל כמה מילים כבר יחשב מקבילה אבל עבור שאר הדברים רק סך מילים.תשובת גרשוני
הנה תשובתו:
Where the code is
The repository is public: להלן הקישור: https://github.com/gershuni/GenizahSearch
Full description of the algorithm: docs/specs/passage-matching-algorithm.md. This is the recommended starting point. It documents every parameter and why it was chosen.
Core implementation: shared/passage_*.py (normalisation, index building, search, and merging results from several witnesses). None of it depends on the Qt or NiceGUI user interfaces, so it can be lifted out as is.
Building an index for another corpus: scripts/build_passage_index.py. The index itself is not in the repository and has to be built locally.
License: CC BY-NC-SA 4.0. That means attribution, non-commercial use only, and ShareAlike: anything built from the code must be released under the same license. It is worth checking that this fits Otzaria's own license.
How the algorithm works, briefly
It compares letters, not words. Text is reduced to a stream of Hebrew letters only. Vowel points, cantillation marks, punctuation and spaces are dropped, and final letters are folded into their regular forms.
It indexes 5-letter sequences. The index stores every sequence of five consecutive letters. A location in the corpus becomes a candidate only if it shares at least two different 5-letter sequences with the query, lined up in roughly the same position.
It verifies each candidate. For each candidate it computes the Levenshtein distance and divides it by the length of the passage. The result is an error density: 0 means identical, and unrelated Hebrew text scores about 0.60.
The acceptance limit depends on length. Short matches must be clean; long matches may be noisier.
The minimum match length is 40 letters after normalisation.
It is built for noisy text. It was designed for automatic transcriptions of Genizah fragments, which have about a 20% letter error rate. That's why it tolerates wrongly split or merged words and full versus defective spelling.
How this fits the request
"Precision as the number of parallel words." Here that corresponds to two settings together: a minimum match length in letters and an error-density limit. The 40-letter minimum is roughly 8–10 words. The minimum length is set per search, not stored in the index, so it can be changed without rebuilding the index.
Different thresholds for different kinds of text (verses versus the rest). This isn't built in, but it can be added as a rule on top of the engine. Below about 40 letters, chance matches increase quickly, so a very short threshold for verses would need calibration, or a requirement that the match be nearly exact.
Comparing a whole library against itself. The published code handles one query against a corpus. The spec also describes batch modes that sweep the whole corpus, but their code was written as research scripts and is not in the public repository. A library self-comparison would therefore need new code:
a loop that runs every passage in the library as a query, or a batch sweep built from the spec;
filtering of full duplicates, such as different editions of the same book;
handling of very common phrases (section 10 of the spec).
A note on clean text. Otzaria's books are relatively clean digital text, so much of the algorithm's noise tolerance isn't needed there. With clean text the thresholds can be tightened. A simpler method, such as matching on word sequences, may be enough for some cases and would be faster.
The quotation-finding tool is a separate Dicta tool and is not part of this repository.
סליחה על האנגלית...מי שיעבוד על זה כדאי שיתן קודם כל את השאלה הזאת לAI כדי להבין מה בדיוק הכי מתאים לאוצריא.
מה ההבדל בין GenizahSearch (הקוד של גרשוני),לבין Dicta Citation Finder (כלי מציאת הציטוטים של דיקטה). -
-
תוסף באופן קצת אחר (מקבילות "חכמות"): מקבילות סמנטיות (חכמות) עבור העיון הנוכחי.
תודה ל@הספריה-התורנית שהעירני לכאן.
-
-
-
יש את זה: https://otzaria.org/forum/post/39979
https://otzaria.org/plugins/6ab67659325e18d8b6fe3fc6
זה כמובן עובד באוצריא קדישא בלי צורך בחיבור לרשת.
הושקע בזה רבות, יש עוד הרבה מה לעשות.
אשמח לשיתוף פעולה.
-
-
אכן כבר כתבתי להרב @איש-שלו, שמא באמת אפשר לשלב את שניהם, אם כי דרך הפעולה שונה. (גם שלי לא צריך חיבור לרשת). הדבר דומה לכלי החיפוש המובנה באוצריא, שכולל חיפוש רגיל (לפי מחרוזת טקסט) וחיפוש חכם, הכ"נ התוסף המשולב יציג מקבילות לפי מחרוזת (כפי הבנתי שזה מה שהתוסף שלו עושה) ולפי הענין.
יש שיפורים רחבים שהייתי רוצה לבצע בו בלא"ה. אי"ה אשנה פרק זה, ואז אראה גם אודות שילוב אי"ה.
-
-
@הספריה-התורנית בתוסף שלי (לפי הענין) קשה להראות על הבדלים בין פסקאות, שהרי אין הכלי משווה מחרוזות טקסט מלכתחילה. אפשר רק לתת מספר, עד כמה טקסט ב דומה לטקסט א מצד הענין. לא בטוח שיש בזה תועלת...
-
@קרית-חנה @איש-שלו אולי כדאי להוסיף בתוסף כלי ידני להשוואה.
מעלים שתי טקסטים זה כנגד זה וכלי מראי על ההבדלים.אפשר לעשות את זה בוורד.
אולי ב'וורד לאוצריא'...[תהיה רק תועלת מצד האבחנה בין סוגי ההבדלים - בלשון ובענין,
וסוגי ההקבלות - בענין במובאה או בלשון.
אבל לא בטוח שהחשיבות גדולה עד כ"כ להשקיע בזה].
שלום! נראה שהשיחה הזו מעניינת אותך, אבל עדיין אין לך חשבון.
נמאס לכם לגלול בין אותם הפוסטים בכל ביקור? כשנרשמים לחשבון, תמיד תחזרו בדיוק למקום שבו הייתם קודם, ותוכלו לבחור לקבל התראות על תגובות חדשות (בין אם במייל, ובין אם בהתראת פוש). תוכלו גם לשמור סימניות ולפרגן ב-upvote לפוסטים כדי להביע הערכה לחברי קהילה אחרים.
בעזרת התרומה שלך, הפוסט הזה יכול להיות אפילו טוב יותר 💗
הרשמה התחברות