소스 검색

新增中文的 stopwords

Signed-off-by: allan716 <[email protected]>
allan716 3 년 전
부모
커밋
bce233995b
3개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 2
      pkg/sub_timeline_fixer/fixer_test.go
  2. 0 0
      pkg/sub_timeline_fixer/stop_words.go
  3. 2 1
      pkg/sub_timeline_fixer/tfidf.go

+ 3 - 2
pkg/sub_timeline_fixer/fixer_test.go

@@ -1,10 +1,11 @@
 package sub_timeline_fixer
 
 import (
+	"testing"
+
 	"github.com/james-bowman/nlp"
 	"github.com/james-bowman/nlp/measures/pairwise"
 	"gonum.org/v1/gonum/mat"
-	"testing"
 )
 
 func TestStopWordCounter(t *testing.T) {
@@ -38,7 +39,7 @@ func TestTFIDF(t *testing.T) {
 
 	query := "the brown fox ran around the dog"
 
-	vectoriser := nlp.NewCountVectoriser(StopWords...)
+	vectoriser := nlp.NewCountVectoriser(EnStopWords...)
 	transformer := nlp.NewTfidfTransformer()
 
 	// set k (the number of dimensions following truncation) to 4

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
pkg/sub_timeline_fixer/stop_words.go


+ 2 - 1
pkg/sub_timeline_fixer/tfidf.go

@@ -3,13 +3,14 @@ package sub_timeline_fixer
 import (
 	"errors"
 	"fmt"
+
 	"github.com/james-bowman/nlp"
 	"gonum.org/v1/gonum/mat"
 )
 
 // NewTFIDF 初始化 TF-IDF
 func NewTFIDF(testCorpus []string) (*nlp.Pipeline, mat.Matrix, error) {
-	vectors := nlp.NewCountVectoriser(StopWords...)
+	vectors := nlp.NewCountVectoriser(EnStopWords...)
 	transformer := nlp.NewTfidfTransformer()
 	// set k (the number of dimensions following truncation) to 4
 	reducer := nlp.NewTruncatedSVD(4)

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.