ai coding system with fuzzy language processing ...

4 downloads 33078 Views 636KB Size Report
Fuzzy logistics are used in natural language processing which takes ... codes are used for application development. .... an android app it creates an APK file.
AI CODING SYSTEM WITH FUZZY LANGUAGE PROCESSING METHOD V. Murugesan1, R. Karthik Raja2 1) Jansons Institute of Technology, [email protected] 2) Sri Managular Vinayagar Engineering College, [email protected]

Abstract: Fuzzy logic deals with the truth values of the given inputs rather than the conventional Booleans. Fuzzy logistics are used in natural language processing which takes advantages over the other language processing methods, including simpler methods of language attributes selection or ability to learn the language in real time environments. Hence fuzzy language processing helps in the formation of the fuzzy language patterns which in turn gets optimised by applying heuristics principles. The optimised language values are searched with predefined set of language value using local genetic search and its appropriate programming codes are used for application development. Then the codes are converted into machine codes with help of multiple compilers and interpreters principles. Keywords: Natural Language processing, Fuzzy logistic, Fuzzy Integral, Fuzzy Pattern, Heuristics, Compilers, Interpreters, Genetic algorithm, Genetic Matching.

1 Introduction Computer came to existence and been popularised only because it had the capacity to solve human problems to make lives of humans easy. For solving our problems, we have to tell the computer how to solve (procedure) and with what (data) to solve. As computer doesn’t understand the natural language we developed programming language to communicate with the computer with the help of machine codes and there comes the birth of computer programming. Computer programming have been evolved in different aspect from the invention of the FORTRAN till now. Whatever may the evaluation aspects it’s only narrows towards used friendly environments and makes programming easier day by day. Let’s take C and java, when C ends up in 20 lines of program for providing a solution for the problem, then java would probably shrinks it into 15 lines or less. This defines the user friendliness and time consumptions. A whole program for a problem in C have been made into a predefined function in Java which can be used at anytime and anywhere without wasting time and breaking the brain. Every software project have to make the coding complete to make it as successful. This coding phase nearly constitute about 35 % of the software project[1], if we reduce this 35% coding scenario by Intelligence, then the development of the software project will be no more complex. Whatever be the scenario of programming it always makes human to work more mentally on memorising the keywords, pattern. But this paper turns around the scenario by making programming intelligence.

2 Conventional Coding From 1957 (invention of Fortran)[2], Computer programming made anything and everything possible but it has to be learnt in a pattern and those pattern has to be applied orderly to get the required solution which in short known to be as syntax. Syntax may differs for different languages, it may be very easy in one language and very tough in another but at the sum this syntax has to be followed in every situation. If one uses incorrect syntax in a compiler it just throws an error and the code has to be converted properly to that compiler, this may often ends up in tensing the user. Let’s take an example like printf in C, cout in C++, system.out.println in Java all makes a similar operation but can’t be changed in different compilers. On considering intermediate code generation of these languages the C++ program produces object code and the Java produce Byte code which appears to be another variation of the languages.

3 Proposed Coding Model In this 21st century intelligence are been embedded in almost all process and applications eg: smart calculator, Smart phones, Smart Homes, Smart cities etc. Then we staying on the conventional programming means, This paper aims to provide Artificial Intelligence Programming system that can help one to program in any means by just using the language that he/she understand (snatural language). Just type in english what your program want to be and get appropriate codes in no time. 3 1 Algorithm Step 1: Get input from a user in form natural language. Step 2: Fuzzy logic principle is used to convert the given input natural language to Fuzzy language pattern. Step 3: Using Heuristics an optimized value of the fuzzy language pattern is obtained. Step 4: The optimized language values are matched with predefined language values by Genetic Matching Techniques. Step 5: Appropriate codes for the optimized value are generated Step 6: The codes are compiled and interpreted accordingly with the given input value

NATURAL LANGUAGE Eg.: English language

Fuzzy logistics

FUZZY LANGUAGE PATTERN

GENETIC MATCHING

OPTIMISED

WITH PREDEFINED

LANGUAGE VALUES

LANGUAGE VALUES

Local genetic search

PRODUCING SOLUTIONS

Using appropriate coding

Heuristics

Fig 1. Basic flowchart for processing the input natural language by fuzzy logics and mapping it with the predefined values using genetic matching and generating necessary codes.

4 Fuzzy principle in natural language processing Fuzzy rules are a collection of linguistic statements that describe how the FIS(fuzzy interference system) should make a decision regarding classifying an input or controlling an output [3]. Fuzzy rules are always written in the following

Total:



1.0 0.7

0.4

0.6 0.4

ttl tite title

Fig 2.1 Fuzzy logic for language ‘Title’

total=data1+data2

Title:

1.0

0.6

0.4

0.5 0.4

ttl totl total

Fig 2.2 Fuzzy logic for language ‘Total’

In the above diagram, when a string 'ttl' is typed both 'title' and 'total' has been detected as an optimal value later allows the user to choose any one value which is substituted as the respective code . Natural language programming is a way of programming language in terms of natural language sentences eg..English. NLP is a computational linguistic concerned with the interaction between machine language and human language. Enabling computers to understand the human language input. They are used in automated online assistant. Here Fuzzy logic-based language processing method, which is applied to language processing. Our purpose is to create a system that can learn from a linguistic corpus of fuzzy semantic relation[4] between the concepts represented by words and use such relations to process the word sequences given as input by the user. In particular, the system will be able to predict the words failed to be analysed by a compiler. This will help to increase the accuracy of a natural language process .

5 Optimising the language pattern by heuristics Heuristics are used to obtain an optimal solution from the pre-obtained fuzzy pattern. The complexity and dynamics of natural language poses considerable difficulties for language or code description. The natural language selection process rely purely on the algorithmic approaches due to uncertainty of linguistic selections. In order to solve this, heuristics models using the fuzzy logic principle are well suited for selection of the natural language code. Multi attribute Decision Making (DM)[5]is treated as a special kind of structured human problem solving which is used to find an optimal solution in linguistic selection of code. Several studies have shown that both the fuzzy and heuristics are the successful tools to provide an optimal solutions using a certain amount of solutions. By the principle of heuristics “On the basis of experience or judgement seems likely to yield a good solution to the problem, but cannot be guaranteed to produce an optimum”[6]. Eventhough the guaranteed for the heuristics are reduced from the following words, Usage of heuristics in Fuzzy patterns which is obtained from the Fuzzy logic, the optimality is maintained as a constant.

Fuzzy pattern value of ttl

ttl :0.4

Ttl(0.4)=title

Ttl(0.4)=total

Manual selection

total=data1+data2

Fig 3. Flowchart for optimising language pattern using Heuristics (taken fuzzy pattern ttl)

6 Genetic matching of the predefined language A Genetic Algorithm (GA) is a search heuristic that mimics the process of natural selection. This heuristic (also sometimes called a meta heuristic) is routinely used to generate useful solutions to optimization and search problems[7].Using Genetic language matching the given input is matched with the predefined code to obtain an optimized matching solutions. The genetic language matching algorithm is analogous to those real time environment “survival of the fittest” or “natural selection”. It is an evolutionary approach to match the predefined words in order to prevent errors. Computationally, the process is similar to biological one to say the human’s mind they divide based on the preferred input. Similarly, this genetic algorithm here searches the codes from the predefined codes in libraries on the basis of given input which has been processed by the fuzzy and heuristic logics.

Fig 4. Genetic matching of optimised language values with predefined values

7 Coding and compiling After the respective code substitution, the codes are compiled to form an executable files or whatever the user wants to. For example: if the user wants to create a website the codes create an html file instead if the user wants an android app it creates an APK file. So we need the functions of all the compilers to be implemented in this process. So that it assures all the needs of user. The mandatory objective of the compilers is to convert the given codes by user to a machine code. So that the user obtains an executable file. Here both the function of the interpreter and compiler are used in order to bring an efficient output.

Fig 5. Formation of source code to Machine code From the following diagram the source code generated automatically by the user convenience will be optimized and converted into respective machine code and then compiled if the constraints or clear. For scripting based, the user words are converted into optimal scripts of HTML,JS,..etc. and interpreted using respective interpreters like browsers

8 Obtained and Predicted results By this AI Coding system all our words in the natural language will be converted into respective programs or scripts based on the user needs by automated pattern recognition using the fuzzy logics and natural language processing methods. The exact result for this system implemented in python programming with nltk module is shown below in fig- 6. This system maps the pattern and uses appropriate code in appropriate language based on the desire of the users form his/her words and make it as an application. While one uses HTML scripts the output will be automatically interpreted in browser or while using Java program the output will compiled using JVM by smart means. The result obtained are from the text input by keyboard means and this can be extended to voice command patterns and makes users just to say what he want and the program for his needs will be generated in no times.

Fig 6. Output of AI coding system with respect to HTML in making websites

9 conclusion No matter how one uses the words he would probably end with generating the required codes. This system facilitates in such a way that even a 10 years old child can program without knowing any of the languages such as C, Java, html, php,...etc. and only knowing English. By this system, programming won’t be any more formidable and problematic and new era of intelligence programming will be invoked. Initially this may use natural text as the input and converts it into the necessary code, but by updating further even one can use voice commands that generates the required code by inbuilt intelligence. This system going to add feather in the hat of AI and helps in the dawn of new coding style.

10 Reference [1] The Evolution of Programming Languages (Course Notes for COMP 348 and COMP 6411- Aug 2002) [2] https://en.wikipedia.org/wiki/Fortran [3] http://www.cs.princeton.edu/courses/archive/fall07/cos436/HIDDEN/Knapp/fuzzy004.html [4] A Fuzzy Semantics for Semantic Web Languages (Dipartimento di Elettronica, Intelligenza Artificiale e Telecomunicazioni (DEIT)) [5] Multi-Attribute Decision-Making Model by Applying Grey Numbers (INFORMATICA, 2009, Vol. 20, No. 2, 305–320) [6] http://www.palgrave-journals.com/jors/journal/v62/n2/full/jors2010160a.html [7] https://en.wikipedia.org/wiki/Genetic_algorithm

Suggest Documents