text.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:lsdc 作者: febert 项目源码 文件源码
def reverse(self, x):
    """Reverses output of transform back to text.

    Args:
      x: iterator or matrix of integers. Document representation in bytes.

    Yields:
      Iterators of utf-8 strings.
    """
    for data in x:
      document = np.trim_zeros(data.astype(np.int8), trim='b').tostring()
      try:
        yield document.decode('utf-8')
      except UnicodeDecodeError:
        yield ''
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号