Changeset 16518


Ignore:
Timestamp:
Aug 10, 2016, 3:11:59 PM (3 years ago)
Author:
dferreira
Message:

Fixing bugs on analysed images and text

Location:
internals/2016/aptoideimagesdetector/trunk/aptoide_mature_app_detector/aptoide_mature_app_detector/explicit_content_detector/API
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • internals/2016/aptoideimagesdetector/trunk/aptoide_mature_app_detector/aptoide_mature_app_detector/explicit_content_detector/API/Explicit_detector/analyse_app.py

    r16516 r16518  
    8787                res = c.fetchone()
    8888                if res:
    89                         icon_l.append(('explicit',res[0]), ('safe',res[1]))
     89                        icon_l.append((('explicit',res[0]), ('safe',res[1])))
    9090                else:
    9191                        res = analyse_explicit(illust2vec, icon)
     
    104104                res = c.fetchone()
    105105                if res:
    106                         screens.append(('explicit',res[0][0]), ('safe',res[0][1]))
     106                        screens.append((('explicit',res[0]), ('safe',res[1])))
    107107                else:
    108108                        res = analyse_explicit(illust2vec, scr)
     
    171171                features['sc_exp'] = maximum_s
    172172                features['sc_non'] = safe_s
    173                 features['desc_exp'] = description_result.prob('exp')
     173                try:
     174                        features['desc_exp'] = description_result.prob('exp')
     175                except:
     176                        features['desc_exp'] = description_result
    174177                return features
    175178        features = find_features(icon_l, screens, description)
  • internals/2016/aptoideimagesdetector/trunk/aptoide_mature_app_detector/aptoide_mature_app_detector/explicit_content_detector/API/views.py

    r16516 r16518  
    134134                webpage = urllib2.urlopen(url+str(app_id)+"/json")
    135135                soup = BeautifulSoup(webpage, "lxml")
    136                                        
     136                                               
    137137                text = soup.get_text()
    138138                page = json.loads(text)
Note: See TracChangeset for help on using the changeset viewer.