我正在使用 spaCy 的句子分割器来分割句子。
from spacy.lang.en import English
nlp = English()
sbd = nlp.create_pipe('sentencizer')
nlp.add_pipe(sbd)
text="Please read the analysis. (You'll be amazed.)"
doc = nlp(text)
sents_list = []
for sent in doc.sents:
sents_list.append(sent.text)
print(sents_list)
print([token.text for token in doc])
Run Code Online (Sandbox Code Playgroud)
输出
['Please read the analysis. (',
"You'll be amazed.)"]
['Please', 'read', 'the', 'analysis', '.', '(', 'You', "'ll", 'be',
'amazed', '.', ')']
Run Code Online (Sandbox Code Playgroud)
标记化已正确完成,但我不确定它是否将第二句与 ( 分开,并将其作为第一句的结尾。
我可以在sql事务过程中使用return语句吗?
sql过程
ALTER PROCEDURE [dbo].[uspProcessStudentRecord]
AS
Begin Transaction
insert into dbo.Student(name,address) values('ABC','INDIA');
return;
Commit Transaction
Run Code Online (Sandbox Code Playgroud)
在事务中写入 return 是一个好习惯吗?
我有 Elastic Search Nest 库代码,需要模拟我从弹性搜索索引获得的响应。
var obj = service.Search<TestDocument>(new student().Query());
var Name= obj.Aggs.Terms("Name");
Run Code Online (Sandbox Code Playgroud)
测试:我在快速观察后创建 Nest 对象,但面临问题 -聚合- 是内部受保护的属性,我无法设置此值。
new Nest.KeyedBucket<object>
{
Key="XYZ school",
KeyAsString=null,
Aggregations=new Dictionary<string, IAggregationContainer>{}
}
Run Code Online (Sandbox Code Playgroud)
请建议我可以用来模拟弹性搜索嵌套对象的解决方案或任何其他方法。