コード例 #1
0
ファイル: part1.py プロジェクト: janbre/IT3105-AIprog
def run(dev, processed):
	
	file_name = "RTE2_dev.preprocessed.xml"
	data_set = part1a.run()
	texts = data_set[0]
	hypos = data_set[1]
	
	parta = "wordmatches.txt"
	partb_1 = "lemma_matches.txt" 
	partb_2 = "pos-tag_matches.txt" 
	partc = "bleuresults.txt"
	partd = "idfresults.txt"
	
	partd_threshold = 0.9670
	partc_threshold = 0.2690	
	parta_threshold = 0.8190
	partb_1_threshold = 0.9170 
	partb_2_threshold = 0.5790
	
	part1b.run(file_name)
	part1c.run(texts, hypos)
	part1d.predict(texts, hypos)
	make_predictions.predict(parta_threshold, parta)
	make_predictions.predict(partb_1_threshold, partb_1)
	make_predictions.predict(partb_2_threshold, partb_2)
	make_predictions.predict(partc_threshold, partc)
	make_predictions.predict(partd_threshold, partd)
コード例 #2
0
ファイル: part2.py プロジェクト: janbre/IT3105-AIprog
def init(file_name):
	print "Starting part II"
#	step_size = 0.001
	threshold = 0.6160
	processed_file = rewrite.run(file_name)
	result = part2a.run(processed_file)
#	predict.predict(step_size, result)
	make_predictions.predict(threshold, result)	# writes predictions to file, does not run eval.py
	print "Part II done"
コード例 #3
0
def index(request):
    if request.method == 'GET':
        print("get req")
        return render(request, 'api/index.html')

    image = request.FILES['img']
    img = Image.open(image)

    img = cv2.resize(np.array(img).astype('float32'), (224, 224))
    print("received Image")

    return HttpResponse(predict(img))