Я пытаюсь объединить списки добавленных предложений в большой текстовый объект строки, чтобы я мог использовать его в качестве входных данных для модуля суммирования Gensim. Тем не менее, когда я пытаюсь сделать это, он говорит, что входные предложения меньше 2. Но когда я выполняю разбиение по тексту, я вижу несколько предложений, но он подсчитывает каждое предложение один раз вместо общего количества предложений вместе. А переменная r является объектом строкового типа. Я хотел бы объединить предложения в одну большую строку, чтобы ее можно было прочитать через модуль суммирования Gensim.
Код образца:
import re
ruling_corpora = re.findall("\.?([^\.].\*?I find[^\.]*\. |[^\.]*$In sum[^\.]*\. |[^\.]*$agree[^\.]*\.)", tokenized, re.I |re.DOTALL |re.M)[1:-1]
for r in ruling_corpora:
print(type(r))
rc= ''.join(r)
print(summarize(rc))
ВЫБОР ВЫБОРА:
raise ValueError("input must have more than one sentence")
ValueError: input must have more than one sentence
Вот пример моего вклада, который я хочу обобщить с помощью сумматора Gensim. Числа под каждой строкой представляют количество предложений, оканчивающихся на периоды:
####Beginning of File### LUMB65.BL23607963.xml
Background Content: ANDERSON INITIAL DECISIONOn January 13, 2015, the appellant filed this appeal arguing that the agency's decision not to renew his term limited appointment which expired on January 28, 2015, is in error.
For the reasons discussed below, this appeal is DISMISSED for lack of jurisdiction without a hearing.
1
There is nothing in the agreement that curtails the agency's ability not to extend the term appointment.
IdIn reviewing the appellant's arguments, the appellant fails to establish that the Board has jurisdiction to review the agency's decision not to renew his time-limited appointment at issue in this appeal.
Following a review of the record evidence, I find that the appellant has failed to non-frivolously allege Board jurisdiction over this appeal on any basis.
Accordingly, this appeal must be dismissed for lack of jurisdiction.
1
####End of File### LUMB65.BL23607963.xml