目录

torcharrow.functional

速腾核心功能

Velox核心功能 包含在 torcharrow.functional 中。

这是一个使用Velox字符串函数lpad的示例:

>>> import torcharrow as ta
>>> from torcharrow import functional
>>> col = ta.column(["abc", "x", "yz"])
# Velox's lpad function: https://facebookincubator.github.io/velox/functions/string.html#lpad
>>> functional.lpad(col, 5, "123")
0  '12abc'
1  '1231x'
2  '123yz'
dtype: String(nullable=True), length: 3, null_count: 0, device: cpu

这是 Velox 数组函数 array_except 的另一个使用示例:

>>> col1 = ta.column([[1, 2, 3], [1, 2, 3], [1, 2, 2], [1, 2, 2]])
>>> col2 = ta.column([[4, 5, 6], [1, 2], [1, 1, 2], [1, 3, 4]])
# Velox's array_except function: https://facebookincubator.github.io/velox/functions/array.html#array_except
>>> functional.array_except(col1, col2)
0  [1, 2, 3]
1  [3]
2  []
3  [2]
dtype: List(Int64(nullable=True), nullable=True), length: 4, null_count: 0

文本操作

add_tokens

在列中追加或插入一个令牌/索引列表。

推荐操作

bucketize

应用桶化输入特征。

sigrid_hash

应用哈希到索引,或者一组索引。

firstx

返回输入列头部的前x个值

has_id_overlap

返回1.0,如果两个输入列重叠,否则返回0.0

id_overlap_count

返回两个id列表之间的重叠数量

get_max_count

如果有输入ID和匹配ID之间有重叠的部分,那么将重叠的ID实例数量贡献到最大计数中。

get_jaccard_similarity

返回输入ID和匹配ID之间的jaccard相似度。

get_cosine_similarity

返回由输入ID加权的向量与匹配ID加权的向量之间的余弦值。

get_score_sum

返回匹配_id_scores中所有匹配_id的总和,其中匹配_id在input_ids中也有对应的id。

get_score_min

返回匹配_id_scores 中所有匹配_id 的最小值,其中匹配_id 在 input_ids 中也有对应的 id。

get_score_max

返回匹配_id_scores 中所有匹配_id 的最小值,其中匹配_id 在 input_ids 中也有对应的 id。

高级操作

scale_to_0_1

将列数据缩放到范围 [0,1]。

文档

访问 PyTorch 的全面开发人员文档

查看文档

教程

获取面向初学者和高级开发人员的深入教程

查看教程

资源

查找开发资源并解答您的问题

查看资源