Browse Source

测试、训练数据加上约束条件

yufeng0528 4 years ago
parent
commit
a7f151de7a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      bbztx/get_data.py

+ 2 - 1
bbztx/get_data.py

@@ -10,7 +10,7 @@ query_articles_sql = '''
10 10
 select a.aid,a.title,a.cities,a.cid,a.other_info,"array_agg"(t.tag_value),days,a.recom,a."rank",read_count
11 11
 from articles a
12 12
 LEFT JOIN article_tags t on a.aid = t.aid
13
-where %s and a.atype = '0'
13
+where %s and a.atype = '0' and cid <> 20 AND title not like '%复制%'
14 14
 and a.stock_aid is NULL
15 15
 GROUP BY a.aid
16 16
 limit 200 OFFSET 0
@@ -51,6 +51,7 @@ def get_articles(filter):
51 51
     attr_list = []
52 52
     for row in rows:
53 53
         attr = {}
54
+        attr['aid'] = row['aid']
54 55
         attr['city'] = row['cities']
55 56
         attr['cid'] = row['cid']
56 57