tensorflow:: ops:: EditDistance
#include <array_ops.h>يحسب مسافة التحرير ليفنشتاين (ربما المعيارية).
ملخص
المدخلات عبارة عن تسلسلات متغيرة الطول مقدمة بواسطة SparseTensors (hypothesis_indices, hypothesis_values, hypothesis_shape) و (truth_indices, truth_values, truth_shape).
المدخلات هي:
الحجج:
- النطاق: كائن النطاق
- hypothesis_indices: مؤشرات قائمة الفرضيات SparseTensor. وهي مصفوفة من نوع int64 بحجم N × R.
- hypothesis_values: قيم قائمة الفرضيات SparseTensor. هذا متجه بطول N.
- hypothesis_shape: شكل موتر SparseTensor لقائمة الفرضيات. وهو متجه بطول R.
- truth_indices: مؤشرات قائمة الحقيقة SparseTensor. وهي مصفوفة من نوع int64 بحجم M × R.
- القيم_الحقيقية: قيم قائمة الحقيقة SparseTensor. هذا متجه بطول M.
- truth_shape: مؤشرات الحقيقة، متجه.
السمات الاختيارية (انظر Attrs ):
- normalize: boolean (إذا كانت القيمة صحيحة، يتم تطبيع مسافات التحرير حسب طول الحقيقة).
الناتج هو:
المرتجعات:
-
Output: موتر كثيف من نوع float برتبة 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
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
الدوال الثابتة العامة
تطبيع
Attrs Normalize( bool x )
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2026-11-05 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[],[]]