Ejemplo n.º 1
0
def main():
    m.initialize()
    utterance = "भीम क्या है और इसका प्रयोग क्यों करना चाहिए ?"
    combinations = m.genUtterances(utterance)
    print(combinations)
    result = m.processUtterance(combinations)
    print(result)
    m.processResult(result)
Ejemplo n.º 2
0
# -*- coding: utf-8 -*-
import os
import re
import module as m
import trainModel
import flask
import warnings
from flask import request, jsonify, make_response, abort
warnings.filterwarnings("ignore")
SERVER_HOST = 'localhost'
SERVER_PORT = 8001
scriptDir = os.path.dirname(__file__)
myMdoel = trainModel.faqModel()
myMdoel.train()
m.initialize()
app = flask.Flask(__name__)
app.config["DEBUG"] = False


@app.route('/faq', methods=['GET'])
def process():
    if not (request.args.get('userUtterance')):
        abort(404)
    userUtterance = request.args['userUtterance']
    utter = userUtterance
    combinations = m.genUtterances(utter)
    result = m.processUtterance(combinations)
    if result:
        result = m.processResult(result)
        return result, 200, {'Content-Type': 'application/json; charset=utf-8'}
    else:
Ejemplo n.º 3
0
#Order = [k for k in range(1,number_of_VM+1)]
Order = module.Order
schedule = module.schedule

print("---- Start initializing ...")
##time.sleep(2)
print("---- [1] Create Host ...")
Host_list = module.create_Host(number_of_Host)
##time.sleep(1)
print("---- [2] Create VM ...")
VM_list = module.create_VM(number_of_VM)
##time.sleep(1)

#초기화된 호스트 리스트 전달 받음
Activated_Host_list, Run_VM = module.initialize(Host_list, VM_list, Run_VM,
                                                Order, Detect_Policy,
                                                VM_Selection_Policy)

print("---- Initailize - [done]\n")
print("---- Start System ...")
##time.sleep(2)
module.Number_of_migration = 0
i = 0
while Run_VM or schedule:
    # flag =0
    # for j in Host_list :
    #     if j.Status != 'Shutdown' :
    #         flag = 1
    #         break
    # if flag == 0 :
    #     module.print_current_status()