【发布时间】:2021-06-04 19:23:03
【问题描述】:
我在我的 ubuntu 上安装了 spaCy 3.0。我使用 ctrl+B 在 sentencizer.py 文件中查找类“sentencizer”的定义:
class Sentencizer(__spacy_pipeline_pipe.Pipe):
"""
Segment the Doc into sentences using a rule-based strategy.
DOCS: https://spacy.io/api/sentencizer
"""
def from_bytes(self, bytes_data, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
"""
Sentencizer.from_bytes(self, bytes_data, *, exclude=tuple())
Load the sentencizer from a bytestring.
bytes_data (bytes): The data to load.
returns (Sentencizer): The loaded object.
DOCS: https://spacy.io/api/sentencizer#from_bytes
"""
pass
...
为什么在 sentencizer.py 中定义的函数中没有内容。在 spaCy github repo 中,没有 sentencizer.py 文件,并且在sentencizer.pyx 中定义了类“sentencizer”:
class Sentencizer(Pipe):
"""Segment the Doc into sentences using a rule-based strategy.
DOCS: https://spacy.io/api/sentencizer
"""
default_punct_chars = ['!', '.', '?', '։', '؟', '۔', '܀', '܁', '܂', '߹',
'।', '॥', '၊', '။', '።', '፧', '፨', '᙮', '᜵', '᜶', '᠃', '᠉', '᥄',
'᥅', '᪨', '᪩', '᪪', '᪫', '᭚', '᭛', '᭞', '᭟', '᰻', '᰼', '᱾', '᱿',
'‼', '‽', '⁇', '⁈', '⁉', '⸮', '⸼', '꓿', '꘎', '꘏', '꛳', '꛷', '꡶',
'꡷', '꣎', '꣏', '꤯', '꧈', '꧉', '꩝', '꩞', '꩟', '꫰', '꫱', '꯫', '﹒',
'﹖', '﹗', '!', '.', '?', '????', '????', '????', '????', '????', '????', '????',
'????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????',
'????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????',
'????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????',
'????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????', '????',
'。', '。']
为什么安装的文件与 github repo 不同?谢谢!
【问题讨论】:
-
当您说使用 ctrl+b 查找定义时,您使用的是什么软件?另外,您的完整 spaCy 版本是什么 - 3.0.3 或更早版本?
标签: spacy