假设我有一段话:
Str_wrds ="Power curve, supplied by turbine manufacturers, are extensively used in condition monitoring, energy estimation, and improving operational efficiency. However, there is substantial uncertainty linked to power curve measurements as they usually take place only at hub height. Data-driven model accuracy is significantly affected by uncertainty. Therefore, an accurate estimation of uncertainty gives the confidence to wind farm operators for improving performance/condition monitoring and energy forecasting activities that are based on data-driven methods. The support vector machine (SVM) is a data-driven, machine learning approach, widely used in solving problems related to classification and regression. The uncertainty associated with models is quantified using confidence intervals (CIs), which are themselves estimated. This study proposes two approaches, namely, pointwise CIs and simultaneous CIs, to measure the uncertainty associated with an SVM-based power curve model. A radial basis function is taken as the kernel function to improve the accuracy of the SVM models. The proposed techniques are then verified by extensive 10 min average supervisory control and data acquisition (SCADA) data, obtained from pitch-controlled wind turbines. The results suggest that both proposed techniques are effective in measuring SVM power curve uncertainty, out of which, pointwise CIs are found to be the most accurate because they produce relatively smaller CIs."
并具有以下test_wrds
Test_wrds = ['Power curve', 'data-driven','wind turbines']
每当Test_wrds
在段落中找到一个句子时,我想选择它的前后两个句子,并将它们作为一个单独的字符串列出。例如,Test_wrds
{Power curve
单词,因此输出类似于
Power curve, supplied by turbine manufacturers, are extensively used in condition monitoring, energy estimation, and improving operational efficiency. However, there is substantial uncertainty linked to power curve measurements as they usually take place only at hub height. Therefore, an accurate estimation of uncertainty gives the confidence to wind farm operators for improving performance/condition monitoring and energy forecasting activities that are based on data-driven methods.
同样,我想将data-driven
和wind turbines
的句子切分,并将它们保存在单独的字符串中
如何使用Python以简单的方式实现这一点
到目前为止,我发现了一段代码,它基本上可以在任何Text_wrds
出现时删除整个句子
def remove_sentence(Str_wrds , Test_wrds):
return ".".join((sentence for sentence in input.split(".")
if Test_wrds not in sentence))
但我不明白如何用这个来解决我的问题
关于这个问题的最新情况:基本上,每当段落中出现test_wrds
时,我都会将该句子以及一个句子前后切分,并将其保存在单个字符串中。例如,对于三个text_wrds
,我希望得到三个字符串,它们基本上分别覆盖了带有text_wrds
的句子。我附加了pdf,例如,输出,我正在寻找
你可以定义一个类似这样的函数
这可以称为
用一些漂亮的印刷品
我们得到了结果
我希望这就是你想要的:)
当你说
我猜你的意思是,所有句子中有一个单词在
Test_wrds
中,在它们前面的句子,在它们后面的句子,也应该被选择作用
运行这个
使用为
Str_wrds
和Test_wrds
提供的值, 返回此输出注:
Test_wrds
中的一个单词,列表元素是该单词的一个匹配项李>相关问题 更多 >
编程相关推荐