From 46ec589180592b1fe653b4a3e8dec5d0d945db73 Mon Sep 17 00:00:00 2001 From: jianfengzhai Date: Fri, 25 Dec 2020 11:30:35 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E5=85=B3=E9=94=AE=E8=AF=8D=E4=B8=AA=E6=95=B0=E5=B0=91?= =?UTF-8?q?=E4=BA=8E=E8=AE=BE=E5=AE=9A=E6=95=B0=E9=87=8F=E6=97=B6=E4=BC=9A?= =?UTF-8?q?=E8=B6=8A=E7=95=8C=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastTextRank/FastTextRank4Word.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FastTextRank/FastTextRank4Word.py b/FastTextRank/FastTextRank4Word.py index f66d14d..3717bf4 100644 --- a/FastTextRank/FastTextRank4Word.py +++ b/FastTextRank/FastTextRank4Word.py @@ -78,8 +78,8 @@ def summarize(self,text,n): scores = util.weight_map_rank(graph,max_iter=self.__max_iter,tol=self.__tol) sent_selected = nlargest(n, zip(scores, count())) sent_index = [] - for i in range(n): - sent_index.append(sent_selected[i][1]) # 添加入关键词在原来文章中的下标 + for worditem in sent_selected: + sent_index.append(worditem[1]) # 添加入关键词在原来文章中的下标 return [index_word[i] for i in sent_index] From a3a9d1fb9e46aaacb5e0701edc4817a9ba08fde4 Mon Sep 17 00:00:00 2001 From: jianfengzhai Date: Sat, 26 Dec 2020 11:24:19 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=92=8C=E8=84=9A=E6=9C=ACtest.txt=E5=92=8Ct?= =?UTF-8?q?estFastTextRank.py;=E5=A2=9E=E5=8A=A0=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E7=9F=AD=E5=8F=A5=E5=8A=9F=E8=83=BD=EF=BC=9B=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=E4=B8=AA=E6=95=B0=E4=B8=BA=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E5=85=B3=E9=94=AE=E8=AF=8D=E4=B8=AA=E6=95=B0=E7=9A=84?= =?UTF-8?q?1/3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/encodings.xml | 4 +- .idea/workspace.xml | 577 +++- FastTextRank/FastTextRank4Word.py | 86 +- .../FastTextRank4Sentence.cpython-36.pyc | Bin 4835 -> 0 bytes .../FastTextRank4Word.cpython-36.pyc | Bin 3638 -> 0 bytes .../W2VTextRank4Sentence.cpython-36.pyc | Bin 4808 -> 0 bytes .../W2VTextRank4Word.cpython-36.pyc | Bin 3614 -> 0 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 296 -> 0 bytes FastTextRank/__pycache__/util.cpython-36.pyc | Bin 6161 -> 0 bytes FastTextRank/test/KeyWord.py | 4 +- FastTextRank/test/test.txt | 2858 +++++++++++++++++ FastTextRank/test/testFastTextRank.py | 38 + 12 files changed, 3392 insertions(+), 175 deletions(-) delete mode 100644 FastTextRank/__pycache__/FastTextRank4Sentence.cpython-36.pyc delete mode 100644 FastTextRank/__pycache__/FastTextRank4Word.cpython-36.pyc delete mode 100644 FastTextRank/__pycache__/W2VTextRank4Sentence.cpython-36.pyc delete mode 100644 FastTextRank/__pycache__/W2VTextRank4Word.cpython-36.pyc delete mode 100644 FastTextRank/__pycache__/__init__.cpython-36.pyc delete mode 100644 FastTextRank/__pycache__/util.cpython-36.pyc create mode 100644 FastTextRank/test/test.txt create mode 100644 FastTextRank/test/testFastTextRank.py diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 15a15b2..97626ba 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,4 +1,6 @@ - + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 471827b..ff9c235 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,38 +1,53 @@ - + + + + + + - - + + + + + + + + + - + - - + + + - + - - + + @@ -40,10 +55,10 @@ - + - + @@ -52,25 +67,22 @@ - + - + + - - - - - - + - + + @@ -118,50 +130,99 @@ - - + + true - DEFINITION_ORDER - -