tensorflow:: ops:: EditDistance
#include <array_ops.h>מחשב את מרחק העריכה של לבנשטיין (אולי מנורמל).
תַקצִיר
הקלטים הם רצפים באורך משתנה המסופקים על ידי SparseTensors (hypothesis_indices, hypothesis_values, hypothesis_shape) ו- (truth_indices, truth_values, truth_shape).
הקלטים הם:
טיעונים:
- היקף: אובייקט היקף
- hypothesis_indices: האינדקסים של רשימת ההיפותזה מציגים את SparseTensor. זוהי מטריצת N x R int64.
- hypothesis_values: הערכים של רשימת ההיפותזה SparseTensor. זהו וקטור באורך N.
- צורת_היפותזה: צורת רשימת ההיפותזות SparseTensor. זהו וקטור באורך R.
- truth_indices: האינדקסים של רשימת ה-truth SparseTensor. זוהי מטריצת M x R int64.
- truth_values: הערכים של רשימת ה-truth SparseTensor. זהו וקטור באורך M.
- צורת_אמת: מדדי אמת, וקטור.
מאפיינים אופציונליים (ראה Attrs ):
- לנרמל: בוליאני (אם נכון, מרחקי עריכה מנורמלים לפי אורך האמת).
הפלט הוא:
החזרות:
-
Output: טנזור צף צפוף עם דרגה R - 1.
עבור קלט הדוגמה:
// hypothesis represents a 2x1 matrix with variable-length values: // (0,0) = ["a"] // (1,0) = ["b"] hypothesis_indices = [[0, 0, 0], [1, 0, 0]] hypothesis_values = ["a", "b"] hypothesis_shape = [2, 1, 1] // truth represents a 2x2 matrix with variable-length values: // (0,0) = [] // (0,1) = ["a"] // (1,0) = ["b", "c"] // (1,1) = ["a"] truth_indices = [[0, 1, 0], [1, 0, 0], [1, 0, 1], [1, 1, 0]] truth_values = ["a", "b", "c", "a"] truth_shape = [2, 2, 2] normalize = true
הפלט יהיה:
// output is a 2x2 matrix with edit distances normalized by truth lengths. output = [[inf, 1.0], // (0,0): no truth, (0,1): no hypothesis [0.5, 1.0]] // (1,0): addition, (1,1): no hypothesis
בנאים והורסים | |
|---|---|
EditDistance (const :: tensorflow::Scope & scope, :: tensorflow::Input hypothesis_indices, :: tensorflow::Input hypothesis_values, :: tensorflow::Input hypothesis_shape, :: tensorflow::Input truth_indices, :: tensorflow::Input truth_values, :: tensorflow::Input truth_shape) | |
EditDistance (const :: tensorflow::Scope & scope, :: tensorflow::Input hypothesis_indices, :: tensorflow::Input hypothesis_values, :: tensorflow::Input hypothesis_shape, :: tensorflow::Input truth_indices, :: tensorflow::Input truth_values, :: tensorflow::Input truth_shape, const EditDistance::Attrs & attrs) |
מאפיינים ציבוריים | |
|---|---|
operation | |
output | |
תפקידים ציבוריים | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
פונקציות סטטיות ציבוריות | |
|---|---|
Normalize (bool x) | |
מבנים | |
|---|---|
| tensorflow:: ops:: EditDistance:: Attrs | קובעי מאפיינים אופציונליים עבור EditDistance . |
מאפיינים ציבוריים
מִבצָע
Operation operation
תְפוּקָה
::tensorflow::Output output
תפקידים ציבוריים
עריכת מרחק
EditDistance( const ::tensorflow::Scope & scope, ::tensorflow::Input hypothesis_indices, ::tensorflow::Input hypothesis_values, ::tensorflow::Input hypothesis_shape, ::tensorflow::Input truth_indices, ::tensorflow::Input truth_values, ::tensorflow::Input truth_shape )
עריכת מרחק
EditDistance( const ::tensorflow::Scope & scope, ::tensorflow::Input hypothesis_indices, ::tensorflow::Input hypothesis_values, ::tensorflow::Input hypothesis_shape, ::tensorflow::Input truth_indices, ::tensorflow::Input truth_values, ::tensorflow::Input truth_shape, const EditDistance::Attrs & attrs )
צוֹמֶת
::tensorflow::Node * node() const
אופרטור::tensorflow::קלט
operator::tensorflow::Input() const
אופרטור::tensorflow::פלט
operator::tensorflow::Output() const
פונקציות סטטיות ציבוריות
לנרמל
Attrs Normalize( bool x )
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2026-11-05 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2026-11-05 (שעון UTC)."],[],[]]