그래서 내가 textblob 파이썬 라이브러리를 사용하고 있지만 성능이 부족합니다.텍스트 분류 성능
나는 이미 그것을 직렬화하고 루프 전에 피클을 사용하여로드한다.
현재 테스트 데이터가 약 0.1 (작은 교육 데이터의 경우) ~ 0.3 (테스트 데이터의 경우 0.3)이 소요됩니다. 나는 그것을 더 빨리 만들 필요가있다?
일부 코드 :
# Pass trainings before loop, so we can make performance a lot better
trained_text_classifiers = load_serialized_classifier_trainings(config["ALL_CLASSIFICATORS"])
# Specify witch classifiers are used by witch classes
filter_classifiers = get_classifiers_by_resource_names(trained_text_classifiers, config["FILTER_CLASSIFICATORS"])
signal_classifiers = get_classifiers_by_resource_names(trained_text_classifiers, config["SIGNAL_CLASSIFICATORS"])
for (url, headers, body) in iter_warc_records(warc_file, **warc_filters):
start_time = time.time()
body_text = strip_html(body);
# Check if url body passess filters, if yes, index, if no, ignore
if Filter.is_valid(body_text, filter_classifiers):
print "Indexing", url.url
resp = indexer.index_document(body, body_text, signal_classifiers, url=url, headers=headers, links=bool(args.save_linkgraph_domains))
else:
print "\n"
print "Filtered out", url.url
print "\n"
resp = 0
이 루프 마녀는이 WARC 파일의 신체 및 메타 데이터의 각 확인 수행합니다.
여기에는 2 가지 텍스트 분류가 있습니다. index_document에서
if trained_text_classifiers.classify(body_text) == "True":
return True
else:
return False
2) (33'000 트레이닝 데이터) :
1) 필터링 (매우 작은 트레이닝 데이터)
prob_dist = trained_text_classifier.prob_classify(body)
prob_dist.max()
# Return the propability of spam
return round(prob_dist.prob("spam"), 2)
분류하고 prob_classify을 취하는 방법이다 성능에 도구.
이 초를 LSA 및 LSI는 분류 성능과 시간을 능가 할 수 있습니까? 0.3 초가 정말 느려지나요? 얼마나 빨리 필요합니까? – syntonym
Perfect는 0.02입니다 (이것은 textblob 구현 이전의 속도입니다). 그러나 현실적입니다. 0.1 근처의 모든 것이 좋을 것입니다! 당신이 도울 수 있다면 어떤 생각이든, 나는 현상금을 내거나 상담 비용을 지불 할 수 있습니다! – IvRRimUm
문제를 재현하는 일부 코드 및 일부 예제 입력 데이터를 표시 할 수 있습니까? – syntonym