zhengkun 11 ماه پیش
والد
کامیت
853722efa0
3فایلهای تغییر یافته به همراه9 افزوده شده و 8 حذف شده
  1. 2 2
      ai/ai_baidu.go
  2. 6 4
      extract/extract.go
  3. 1 2
      main.go

+ 2 - 2
ai/ai_baidu.go

@@ -50,7 +50,7 @@ func PostZhiPuInfo(content string) map[string]interface{} {
 		if zp = PostZhiPuAI(content); len(zp) > 0 {
 			break
 		}
-		if ok >= 5 {
+		if ok >= 2 {
 			break
 		}
 	}
@@ -69,7 +69,7 @@ func PostZhiPuClassInfo(content string) (map[string]interface{}, bool) {
 			ok = true
 			break
 		}
-		if times >= 5 {
+		if times >= 2 {
 			break
 		}
 	}

+ 6 - 4
extract/extract.go

@@ -103,13 +103,15 @@ func ConfrimExtractInfo(q map[string]interface{}) map[string]interface{} {
 	sess := ul.SourceMgo.GetMgoConn()
 	defer ul.SourceMgo.DestoryMongoConn(sess)
 	total := 0
-	it := sess.DB(ul.SourceMgo.DbName).C(ul.Ext_Name).Find(&q).Select(map[string]interface{}{"_id": 1}).Iter()
+	it := sess.DB(ul.SourceMgo.DbName).C(ul.Ext_Name).Find(&q).Select(map[string]interface{}{"_id": 1, "ai_zhipu": 1}).Iter()
 	for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
-		if total%100000 == 0 {
+		if total%1000 == 0 {
 			log.Debug("cur index ", total)
 		}
-		tmpid := ul.BsonTOStringId(tmp["_id"])
-		dict[tmpid] = tmpid
+		if tmp["ai_zhipu"] == nil { //已经识别的数据-不再识别
+			tmpid := ul.BsonTOStringId(tmp["_id"])
+			dict[tmpid] = tmpid
+		}
 		tmp = make(map[string]interface{})
 	}
 	return dict

+ 1 - 2
main.go

@@ -9,12 +9,11 @@ import (
 func init() {
 	ul.InitGlobalVar()
 	udp.InitProcessVar()
-
+	
 }
 
 func main() {
 	log.Debug("main ...")
-	//extract.ExtractFieldInfo("100000000000000000000000", "900000000000000000000000")
 	lock := make(chan bool)
 	<-lock
 }