示例#1
0
def main():
    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    #    inputTextPath = '/home/reterik/Automatic-Question-Generator/AutomaticQuestionGenerator/DB/db.txt'
    #    readFile = open(inputTextPath, 'r+', encoding="utf8")
    #    readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')

    inputText = (sys.argv[2])
    # readFile.read()
    #    inputText = '''I really am happy that this actually works I need to input a bunch of text to see what the output is.'''

    my = db.cursor()
    my.execute('select * from 2019_09_24 limit 1')
    result = my.fetchall()

    for x in result:
        a = x[0]
        b = x[1]
        c = x[2]
        d = x[3]
        e = x[4]
        print(a, b, c, d, e)
        #print(x)
        inputText = b + e

    print(inputText)

    questionList = aqg.aqgParse(inputText)
    aqg.display(questionList)

    aqg.DisNormal(questionList)

    return 0
示例#2
0
def make_question(data):
    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    """inputTextPath = "input file path -- ?? ../DB/db.txt"
    readFile = open(inputTextPath, 'r+', encoding="utf8")
    #readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')

    inputText = readFile.read()
    #inputText = '''I am Dipta. I love codding. I build my carrier with this.'''
    """
    questionList = aqg.aqgParse(data)
    aqg.display(questionList)
    return questionList
def main():
    # Getting the Input from the User
    fileName= str(input('Enter the path of the file '))
    # Text Extraction from the input
    text= TextExtraction(fileName)
    
    #saving the text extracted
    name='document.txt'
    file= open('document.txt', 'w')
    file.write(text)
    file.close()
    
    # Which part to learn
    read= str(input('Do you want to learn:\n a) whole document\n b) Part of document\n'))
        
    if read.lower()=='whole document':
        name= 'document.txt'
    
    else:
        keywords=ExtractKeywords(name)
        doc_dict=subTopicSeperation(name)
        print(keywords)
        subtopic=str(input('Select the topics from the above list:\n'))
        subtopic=subtopic.split()
        text= keywordSearch(doc_dict, subtopic)
        name= 'currentTopic.txt'
        file= open('currentTopic.txt', 'w')
        file.write(text)
        file.close()

    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    #inputTextPath = name
    readFile = open(name, 'r+')
    #readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')

    inputText = readFile.read()

    questionList = aqg.aqgParse(inputText)
    output=aqg.display(questionList)
    output= CleanQues(output)
    answers= Answers(text,output)
    # Giving the question to the user
    for i in range (len(answers)):
        print('Q. {}'.format(output[i]))
        time.sleep(5)
        print('Ans: {}'.format(answers[i]))
        print('\n')
    def soruUret():
        aqg = aqgFunction.AutomaticQuestionGenerator()
        global textAl
        textAl = text_area.get('1.0', tk.END)
        sorular = aqg.aqgParse(textAl)

        soruFormatindaSorular = aqg.display(sorular)
        #print("sorular1",soruFormatindaSorular)
        ayriSorular = soruFormatindaSorular.split("_")
        #print("sorular2",ayriSorular)

        for j in range(len(soruFormatindaSorular)):
            text_area2.insert(j + 1, ayriSorular[j + 1])
            print("\n")
        """
示例#5
0
def main():
    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    inputTextPath = "DB/test.txt"
    readFile = open(inputTextPath, 'r+', encoding="utf8")
    #readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')

    inputText = readFile.read()


    questionList = aqg.aqgParse(inputText)
    aqg.display(questionList)

    #aqg.DisNormal(questionList)

    return 0
示例#6
0
def main():
    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    inputTextPath = "DB/db.txt"
    readFile = open(inputTextPath, 'r+', encoding="utf8")
    #readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')

    inputText = readFile.read()
    #inputText = '''I am Dipta. I love codding. I build my carrier with this.'''

    questionList = aqg.aqgParse(inputText)
    aqg.display(questionList)

    #aqg.DisNormal(questionList)

    return 0
示例#7
0
def main():

    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    # store your content into ./DB/db.txt file
    # Use the function getContentFromFile
    inputTextPath = "./DB/db.txt"
    readFile = open(inputTextPath, 'r+', encoding="utf8")

    inputText = readFile.read()
    #inputText = '''I am Dipta. I love codding. I build my carrier with this.'''

    questionList = aqg.aqgParse(inputText)
    # print(questionList)
    aqg.display(questionList)

    return 0
示例#8
0
def main():
    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    # Enter input Text File PATH
    # inputTextPath = "DB/db.txt"
    # readFile = open(inputTextPath, 'r+')
    # inputText = readFile.read()
    a = pd.read_csv('mydata.csv', names=["titles", "paragraphs"])
    column_length = len(a['paragraphs'])
    for i in range(14900, column_length):
        inputText = a["paragraphs"][i]
        questionList = aqg.aqgParse(inputText)
        aqg.display(questionList)

    # questionList = aqg.aqgParse(inputText)
    # aqg.display(questionList)

    return 0
示例#9
0
文件: main.py 项目: reterik/god.blue
def main():
    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

#    inputTextPath = '/home/reterik/Automatic-Question-Generator/AutomaticQuestionGenerator/DB/db.txt'
#    inputTextPath = '/var/lib/mysql-files/2019_09_30.sql'
#    readFile = open(inputTextPath, 'r+', encoding="utf8")
#    readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')

    inputText = (sys.argv[2])
#    inputText = readFile.read()
#    inputText = '''I really am happy that this actually works I need to input a bunch of text to see what the output is.'''
#    print(inputText)

    questionList = aqg.aqgParse(inputText)
    aqg.display(questionList)
    f = ''
    aqg.DisNormal(questionList)
    return 0
示例#10
0
def HELLO():
    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    # inputTextPath = "input file path -- ?? ../DB/db.txt"
    # readFile = open(inputTextPath, 'r+', encoding="utf8")
    #readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')

    # inputText = readFile.read()
    # inputText = 'Whilst technologies, such as psychophysiological measurements in general and electroencephalograms (EEG) in particular, have been around and continually improving for many years, future technologies promise to revolutionise the emerging Information Society through the development of brain-computer interfaces and augmented cognition solutions. This paper explores critical psychological and pragmatic issues that must be understood before these technologies can deliver their potential well. Within the context of HCI, we examined a sample (n = 105) BCI papers and found that the majority of research aimed to provide communication and control resources to people with disabilities or with extreme task demands. However, the concepts of usability and accessibility, and respective findings from their substantial research literatures were rarely applied explicitly but referenced implicitly. While this suggests an increased awareness of these concepts and the related large research literatures, the task remains to sharpen these concepts and to articulate their obvious relevance to BCI work.'
    # inputText = '''My best friend and I have been studying in the same school since kindergarten. We have been classmates each year at school. We share a very close bond and have a special friendship that we cherish and treasure. My friend is my partner, sitting beside me in class. She is kindly and helpful, and if I have any difficulties in understanding any topic in my studies, or in completing my homework or school project, she helps me. She is brilliant in mathematics and the sciences, while I am good at English. So we both help each other in whatever way possible. She helps me without ever belittling me. I greatly appreciate the quality in her. She does not make me feel obliged. There is a slight chance of rain today.'''
    inputText = '''Shah Jahan was widely considered to be the most competent of Emperor Jahangir's four sons and after Jahangir's death in late 1627, when a war of succession ensued, Shah Jahan emerged victorious. He put to death all of his rivals for the throne and crowned himself emperor in January 1628 in Agra under the regnal title "Shah Jahan" (which was originally given to him as a princely title). Although an able military commander, Shah Jahan is perhaps best remembered for his architectural achievements. The period of his reign is widely considered to be the golden age of Mughal architecture. Shah Jahan commissioned many monuments, the best known of which is the Taj Mahal in Agra, which entombs his wife Mumtaz Mahal. In September 1657, Shah Jahan fell seriously ill, which set off a war of succession among his four sons, in which his third son Aurangzeb, emerged victorious.[10] Shah Jahan recovered from his illness, but Aurangzeb put his father under house arrest in Agra Fort from July 1658 until his death in January 1666.[11] On 31 July 1658, Aurangzeb crowned himself emperor under the title "Alamgir".[12]'''

    questionList = aqg.aqgParse(inputText)
    # print(questionList)
    WHquestions = aqg.display(questionList)

    #aqg.DisNormal(questionList)

    return WHquestions
示例#11
0
def generate(filename):
    # Create AQG object
    aqg = aqgFunction.AutomaticQuestionGenerator()

    #inputTextPath =r"C:\Users\hp\Downloads\Automatic-Question-Generator-master\AutomaticQuestionGenerator/DB/db.txt"
    inputTextPath = filename
    readFile = open(inputTextPath, 'r+', encoding="utf8")
    #readFile = open(inputTextPath, 'r+', encoding="utf8", errors = 'ignore')

    inputText = readFile.read()
    #inputText = '''I am Dipta. I love codding. I build my carrier with this.'''

    questionList = aqg.aqgParse(inputText)
    aqg.display(questionList)
    print("**********************")
    print(aqg.filename)
    print("**********************")

    #aqg.DisNormal(questionList)

    return 0