tensorflow::ops::StringSplitV2

#include <string_ops.h>

แยกองค์ประกอบของ source ตาม sep ออกเป็น SparseTensor

สรุป

ให้ N เป็นขนาดของแหล่งข้อมูล (โดยทั่วไป N จะเป็นขนาดของชุดข้อมูล) แบ่งแต่ละองค์ประกอบของ source ตาม sep และส่งคืน SparseTensor ที่มีโทเค็นที่แบ่งแล้ว โทเค็น ว่าง จะถูกละเว้น

ตัวอย่างเช่น ถ้า N = 2, source[0] คือ 'hello world' และ source[1] คือ 'ab c' ผลลัพธ์ที่ได้จะเป็นดังนี้

st.indices = [0, 0;
              0, 1;
              1, 0;
              1, 1;
              1, 2]
st.shape = [2, 3]
st.values = ['hello', 'world', 'a', 'b', 'c']

หากระบุค่า sep ตัวคั่นที่อยู่ติดกันจะไม่ถูกจัดกลุ่มเข้าด้วยกันและจะถือว่าเป็นตัวคั่นสตริงว่าง ตัวอย่างเช่น source ของ "1\<\>2\<\>\<\>3" และ sep ของ "\<\>" จะคืนค่า ["1", "2", "", "3"] หาก sep เป็น None หรือสตริงว่าง ช่องว่างที่อยู่ติดกันจะถือว่าเป็นตัวคั่นเดียว และผลลัพธ์จะไม่มีสตริงว่างที่ต้นหรือท้ายหากสตริงมีช่องว่างนำหน้าหรือต่อท้าย

โปรดทราบว่าพฤติกรรมที่กล่าวถึงข้างต้นตรงกับคำสั่ง str.split ของ Python

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • อินพุต: Tensor สตริง 1-D ซึ่งเป็นสตริงที่ต้องการแยก
  • sep: Tensor เซอร์สตริง 0-D มิติ อักขระคั่น

คุณลักษณะเสริม (ดูที่ Attrs ):

  • maxsplit: int ถ้า maxsplit > 0 จะเป็นขีดจำกัดของการแบ่งผลลัพธ์

การส่งคืนสินค้า:

ตัวสร้างและตัวทำลาย

StringSplitV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input sep)
StringSplitV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input sep, const StringSplitV2::Attrs & attrs)

คุณลักษณะสาธารณะ

indices
operation
shape
values

ฟังก์ชันคงที่สาธารณะ

Maxsplit (int64 x)

โครงสร้าง

tensorflow:: ops:: StringSplitV2:: Attrs

ตัวเลือกในการตั้งค่าแอตทริบิวต์สำหรับ StringSplitV2

คุณลักษณะสาธารณะ

ดัชนี

::tensorflow::Output indices

การดำเนินการ

Operation operation

รูปร่าง

::tensorflow::Output shape

ค่านิยม

::tensorflow::Output values

หน้าที่สาธารณะ

สตริงสปลิตวี2

 StringSplitV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input sep
)

สตริงสปลิตวี2

 StringSplitV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input sep,
  const StringSplitV2::Attrs & attrs
)

ฟังก์ชันคงที่สาธารณะ

แม็กซ์สปลิต

Attrs Maxsplit(
  int64 x
)