Individualized Grammar Learning API

    image

    Individual instruction in a foreign language always works better than training in general programs and in materials that “suit everyone”. Indeed, the programmer and the florist are interested in different topics, different texts, which means different language material (vocabulary in the first place). And many services that help learn a foreign language, try to build training in this way. For example, in LinguaLeo you can add your own texts or choose from the large library those that are most interesting, and learn the language, more precisely - the vocabulary, from these texts. Easy Ten lets you choose thematic word lists. But all this is about vocabulary. What about grammar? Is it possible to study grammar individually?


    Why learn grammar individually?


    Really - why? The grammar is the same everywhere - both in texts about flowers and in texts about algorithms. This is one of the reasons why grammar teaching is now being built in a fairly uniform way: usually one grammar course is offered, consisting of static sections, where grammatical material is defined, and then it is proposed to do several exercises. All of the material mentioned has no relation to topics of interest to the student.


    The second reason why individualized grammar training is not offered is because it is technically more difficult than extracting words and counting simple metrics like TFIDF . To extract grammatical constructions from a text, a more complex lexico-grammatical and morphological analysis of the text is needed.


    It would seem - why do something that is not necessary, and even difficult?


    How grammar is related


    In fact, learning grammar is not about remembering rules. Grammar does not exist by itself out of touch with vocabulary. Any grammatical rule is an abstract description of a large number of structurally similar statements, which are expressed precisely with the help of words. Thus, it turns out that grammar is directly related to vocabulary, and therefore - with the subject matter of the material on which the training takes place. Therefore, examples of the use of grammatical constructions, exercises that train and consolidate grammatical material, can and should have the lexical content that is interesting and useful to the student of the language.


    How do you learn grammar?


    Individualized grammar training can be based on almost any textual material of the user. For each sentence, grammatical phenomena are determined and exercises are created on their basis.


    Thus, for example, for each sentence in the text, you can make a link to information about the corresponding grammatical phenomenon, and also create several types of exercises:
    Choosing the correct form from several proposed
    For example:


    My friend has never ... to Paris.
    1. been
    2. was
    3. being
    4. is

    Error correction
    For example:


    My friend have never been to Paris.

    Using the correct form of the word (put the word in the desired form or enter the correct form of the word)


    For instance:


    My friend has never (be) to Paris.
    or
    My friend has never ... to Paris.

    Indication of grammatical structure
    For example:


    My friend has never been to Paris.
    Present perfect

    It is these two tasks that our API solves: in each sentence, it finds grammatical constructions and creates grammar exercises from the sentences found.


    API


    There is an open API for everyone who would like to try to make a useful service for individualized learning English grammar or to add to their existing service this functionality.


    To get access to the API you need to register on the service https://market.mashape.com . After registration, follow the linkhttps://market.mashape.com/smallstep/englishgrammar and sign up for the free API.


    The input is text in the form of JSON sent via a POST request, for example:


    {
      "text": "John lives in London. He loves cats."
    }

    In the documentation on the API page, you will find code examples for many programming languages: Java, Node, PHP, Python, Objective-C, Ruby, .NET.


    In response, you get JSON with the following content:


    {
        "grammarPatterns": [
            {
                "sentenceText": "John lives in London.",
                "grammarPatterns": [
                    {
                        "name": "present_simple_construction",
                        "words": [
                            {
                                "word": "lives",
                                "startOffset": 5,
                                "endOffset": 10
                            }
                        ],
                        "dependencies": [
                            "present_simple_usage"
                        ],
                        "difficulty": 1,
                        "fullName": "Настоящее простое время (Present Simple Tense)"
                    }
                ]
            },
            {
                "sentenceText": "He loves cats.",
                "grammarPatterns": [
                    {
                        "name": "present_simple_construction",
                        "words": [
                            {
                                "word": "loves",
                                "startOffset": 3,
                                "endOffset": 8
                            }
                        ],
                        "dependencies": [
                            "present_simple_usage"
                        ],
                        "difficulty": 1,
                        "fullName": "Настоящее простое время (Present Simple Tense)"
                    }
                ]
            }
        ],
        "multipleChoice": [
            {
                "sentenceText": "John lives in London.",
                "multipleChoice": [
                    {
                        "startOffset": 5,
                        "endOffset": 10,
                        "answers": [
                            "live",
                            "living",
                            "lives",
                            "lived"
                        ],
                        "correctIndex": 2
                    }
                ]
            },
            {
                "sentenceText": "He loves cats.",
                "multipleChoice": [
                    {
                        "startOffset": 3,
                        "endOffset": 8,
                        "answers": [
                            "loves",
                            "love",
                            "loving",
                            "loved"
                        ],
                        "correctIndex": 0
                    }
                ]
            }
        ]
    }

    As you can see from the example, the text is divided into sentences and for each sentence there are grammarPatterns (identified grammatical constructions) and multipleChoice (material for creating exercises).
    In grammarPatterns specified system name grammatical structure ( name ) given words that form a given grammatical phenomenon, with offset from the beginning of the sentence ( words ) dependencies (grammar that would help in the development of the grammatical phenomenon), the relative level of difficulty ( difficulty - may help in assessing the grammatical difficulty of the text), and fullName - The full name of the design in Russian.


    In multipleChoice, the offsets of the word for which the exercise is proposed are given. Answers are the answer options for multiple choice, and correctIndex is the index of the correct answer (index starts at 0).


    In the simplest case, the API allows you to create an exercise to choose the right shape, but other exercises are not at all difficult to do. For example, for the “correct a mistake” exercise, you just need to replace the word in the sentence with one of the incorrect options from the answers field. To enter the correct variant, you can simply remove the word from the original sentence (you can also specify the name of the desired form from grammarPatterns ).


    You can test our API on a small number of your examples (up to 400 characters per request, please)), but if you want to use it in some project, it is better to contact in person.


    Announcement


    A little later we plan to open the API diagnosing mutiple choice (grammatical and lexical), as well as the API for generating questions to the text (and answer options for it).


    UPDATE : Thank you for your great interest in our project.))
    For technical reasons, we slightly changed the API. Please pay attention to the example above - now there are two lists, in each of which the text of the sentence is repeated.


    Also popular now: