• 沒有找到結果。

Grammar and Question Structure Evolution

Chapter 3 Folksonomy-Based Arithmetic Word Problems Collection and

3.5 Grammar and Question Structure Evolution

3.5.1 Arithmetic Word Problem Grammar and applying Question Scenario

Teachers often construct various arithmetic word problems via transforming the arithmetic logic embedded in one arithmetic word problem. By our observation, production rules in context-free grammar are appropriate to describe this kind of transformation. Besides, applying context-free grammar can facilitate maintenance of arithmetic word problems and their evolutions. A context-free grammar is a grammar that the left side of every production rules is always a single nonterminal symbol and the right side is a string of terminals and/or nonterminals. Based on the previous definition of context-free grammar, we can use different nonterminals to denote different major problem categories and sub-problem categories. The production rules from nonterminals of major problem categories only derive the nonterminals of their corresponding sub-problem categories. Hence, this grammar property can help us easily manage arithmetic word problems. Moreover, the similar new arithmetic word problems

can be generated from an arithmetic word problem by adding new production rules, evolving from the production rules of the original question structure.

Besides, two questions can be integrated to generate new question structures by combining production rules of two question structures. These two question evolution and fusion approaches are named self-evolution and collaborative-evolution, respectively. The following chapters will show how to model an arithmetic word problem by context-free grammar, and how to perform self-evolution and collaborative-evolution based on the grammar. For providing proper mapping from question structures to question scenarios, our context-free grammar also contains production rules which drive question structures through question requirements into scenario slots, the terminal symbols.

Definition 1: Arithmetic Word Problem Grammar

 G = (V, T, P, S) is the arithmetic word problem grammar where V = {S} 

 C is a set of major problem category non-terminal symbols

 B is a set of sub-problem category non-terminal symbols

 QS is a set of question structure non-terminal symbols.

 QR = QRV  QRF QRV’ is a set of question requirement non-terminal

 QRV is a set of question requirement which contains numeric variable, is called “variable type” question requirement.

 QRF is a set of question requirement which not contains no numeric variable, is called “fix type” question requirement.

 QRV’ is a set of question requirement which is a question statement, and is variable type question requirement too.

 T = SSU  SSC is a set of terminal symbols,

 SSU is a set of scenario slot which contains variable, is called “unknown type” scenario slot.

 SSC is a set of scenario slot which does not contain variable, is called

“changeable type” scenario slot.

 P =CP BP QSP  QRP  SSP is a set of production rules

CP is a set of major problem category production rules, which is

S→C1 | C2 | …| Cp, where Ci  C, 1 i≦p, p is the number of major problem categories.

BP is a set of sub-problem category production rules, which is

Ci→Bi1 | Bi2 | | Biq, where Bij  B, 1j≦q, q is the number of sub-problems in major problem category Ci

QSP is a set of question structure production rules, which is

 Bij→QSij1 | QSij2| | QSijr, where QSijk  QS, 1≦k≦r, r is the number of question structures in sub-problem category Bij.

QRP is a set of question requirement production rules, which is

QSijk→ QRXijk1QRXijk2 …QRijksV ’

, where QRijkm  QR, 1m≦s, s is the number of question requirements in question structure QSijk , X  {V, F}.

SSP is a set of scenario slot production rules, which is

QRijkm → SSXijkm1SSXijkm2 …SSXijkmt, where SSijkmn  SS, 1n≦t, t is the number of scenario slots in question requirement QRijkm , X  {C, U}.

The number of production rules in P is depending on the corresponding instances which are provided by users. For example, if users add a new sub-problem category, then a new production rule corresponding with this new sub-problem will be added to BP, and if users provided a new question structure, then a new production rule corresponding with this new question structure will be added to QSP.

The major problem category production rules (CP) are defined to represent the rules of generating the major problem categories in arithmetic word problem frame hierarchy. The usage of CP is shown in Example 1.

Example 1: Production rule of CP S→ 植樹問題 |周長問題 |…

The initial start symbol can generate all the major problem category non-terminal symbols, such as “tree-plant problem” and “perimeter problem”.

Each major problem category non-terminal symbol can be transformed to a set of sub-problem category non-terminal symbols using sub-problem category production rules (BP).

Example 2: Production rule of BP

植樹問題→ 直線種樹 |多邊形種樹 |…

This sub-problem category production rule shows that “直線種樹” and “多 邊形種樹” are two sub-problem categories of “tree-plant problem”.

Question structures are included in sub-problem categories and the question structure production rules (QSP) can show this grammar.

Example 3: Production rule of QSP 直線種樹→ 兩端種樹 |一端種樹 |…

Assume there are two question structure “兩端種樹” and “一端種樹” in category “直線種樹”, QS1, the production rules of QSPare used to generate all the question structure non-terminal symbols.

An arithmetic word problem consists of a set of statements, named question requirement, to describe the question’s constraints and requirements, and one of the question requirements have to be described as a question statement. For example, a problem of “square perimeter” consists of at least three statements to describe “object shape”, “square side” and “square perimeter”, and the “square

perimeter” or “square side” can be described as a question to ask students. The question requirements, which contain numeric variables and can be described as a question statement, are named variable type question requirement (QRV), and others are named fix type question requirements (QRF).

Example 4: User provide a perimeter problem Question Structure

An arithmetic problem “perimeter problem” can be represented as QSperimeter→QRF1 QRV2QRV’3, where QRF1 is “object shape”, QRV2 is “square side”, and QRV3 is “square perimeter”. In this question, the variable type question requirements need to be identified, such as “square side” and “square perimeter”, and one of the variable type question requirements needs to be determined as the question statement by user, e.g. , QRV’3.

Example 5: Production rule of QRP

Assume an arithmetic word problem of “兩端種樹植樹問題” is “榕樹 100 顆,種在公路一旁,每隔5公尺種一棵,兩端都種,公路 500 公尺”. The question structure “ 兩 端 種 樹 ” can be represented as five question requirements: ”樹的總數”, “路旁種法”, ”樹的間隔” , “兩端種法” , and “路 長”, so the question requirement production rule can be defined as follows:

兩端種樹→樹的總數,路旁種法,樹的間隔,兩端種法,路長’.

Among the question requirements, “榕樹 100 棵” and “公路 500 公尺” are variable type question requirements because 100 and 500 are numeric variables.

“種在公路一旁” and “兩端都種” are fix type question requirements, which cannot be transformed to the question statement. “公路 500 公尺” is determined as the question statement by user. Thus, folksonomy-based item bank management system will generate the sentence of question requirement “請問公 路多少公尺”.

Every Question Requirement consists of a set of the corresponding description statements, named scenario slot, to describe each requirement in different words or sentences. For example, a requirement of “樹的總數” consists of at least three words to describe “種的物品”, “數量”, and “物品單位”. The “種的物品” can be described by different words or sentences like “花” , “樹” or “電線桿” ,etc. , and the “物品單位” must be related with the “種的物品”. The “數量” can be any numeric variable like 100,150 or 20, etc. The scenario slots, which contains only number, are named unknown type scenario slot (SSU), and others are named changeable type scenario slot (SSC). Each tag of scenario slot like, “種的物品” or

“數量”, etc. are provided by users, in other words, we are not focus on dealing with the natural language processing in this thesis.

Example 6: Production rule of SSP

Assume QR1 is one of “兩端種樹” question requirement consist of three scenario slot, which are “種的物品”, “數量”, and “物品單位”. So the scenario slot production rule can be defined as follows:

兩端種樹→種的物品,數量,物品單位.

The scenario slots are involved in question requirement will be applied to corresponding value in scenario repository, thus the sentence of question requirement will be diverse. Question scenarios provided by users will be stored in Scenario Repository. We will introduce Scenario Repository in more detail in Section 3.6.2.

Figure 5 Scenario Slot of QR1

Figure 5 shows that each scenario slot in QR1 will be applied to the corresponding value in scenario repository.

If the scenario p1 be applied to the scenario slots, which are involved in QR1, then the sentence of QR1 will be:

“電線桿 200 根”.

If the scenario p2 applied to the scenario slots, then the sentence of QR1will be:

“旗子 50 支”.

Among the scenario slots, “數量” is unknown type scenario slot because it will be applied to every number 200, 50,100 in scenario repository. “種的東西” and

“物品單位” are changeable type scenario slots, because each of them applied to the values in Scenario Repository like “榕樹” and “顆”are not numbers.

Example 7: Mapping Scenario to Question Structure

The rules embedded in arithmetic word problem frame can control the question structure to apply different scenario as shown in Figure 6.

Figure 6 Scenario mapping to Question Structure

QRV’ is the question statement as we mentioned before.

The rule of applying scenario to QRV’ is:

Add ”請問” in front of QRV’ first and change the scenario slot value to “多少” if scenario slot type is unknown in QRV’. Finally, the sentence of QRV’ will be shifted and become the last sentence in the generating arithmetic word problem.

Example 8: Applying scenario to QRV’

Assume the question requirement of “兩端種樹問題”is:

兩端種樹問題→樹的總數,路旁種法,樹的間隔,兩端種法,路長.

If we apply scenario P1 to the “兩端種樹問題”,the sentences are:

“公路 300 公尺,每隔 3 公尺種一棵,種在公路一旁,兩端都種,請問樹多 少顆?”.

And if the question requirement of ”兩端種樹問題”is:

兩端種樹問題→樹的總數,路旁種法,樹的間隔,兩端種法,路長.

If we mapped scenario P1 to the “兩端種樹問題”,the sentences are:

“樹 100 顆,每隔 3 公尺種一棵,種在公路一旁,兩端都種,請問公路多少公 尺?”.

We have introduced how to model an arithmetic word problem by context-free grammar. In next section we will introduce how to evolve question structure by production rules. We have two kinds of evolution methods to evolve question structure, one is Self-Evolution and another is Collaborative-Evolution.

3.5.2 Self-Evolution

Each arithmetic word problem has its question structure in which a propositional logic statement is embedded. Only one atomic proposition, which is a variable type question requirement, of the statement will be chosen as the question statement. However, this selection is not unique. Every atomic proposition can be selected as the question statement. In arithmetic word problems, we only focus on the atomic propositions correlated to variable type question requirements. In order to generate different problems, self-evolution is to select different atomic propositions from the original propositional logic statement as the question statement. Therefore, we can add new production rules generated via self-evolution into QRP, which contains production rules drive question requirements from question structure. Figure illustrates the concept of self-evolution.

Figure 7 Self-evolution

Assume there is a multiplication problem, “A × B = C”. Usually, teacher will test students with the question: “A × B = ?”, or with the questions “A × ?

= C” and “? × B = C” which are obviously different questions from the previous one. These two questions can be generated by self-evolution. Assume user provided a question structure QS1.

The original production rule QRPof QS1 is:

QS1→QRV1

QRV2 QRV3

The new production rule QRPof QS1 after applying Self-Evolution:

QS1→QRV1

QRV2 QRV3 | QRV1 QRV2

QRV3 | QRV1 QRV2 QRV3

The two production rules, which are QRV1 QRV2QRV3 and QRV1 QRV2 QRV3 will be added in production rule automatically after applied self-evolution.

Assume QS1 is a multiplication problem, its production rule QRP is QS1→ABC’, A, B and C are variable type question requirement. There are three variable type question requirements, so we add two production rules after production rule QRP of QS1. The production rule QRP of QS1 will be QS1→ABC’|AB’C|A’BC, that ABC’, AB’C and A’BC is questions:

A × B = ?.

A × ? = C.

? × B = C.

Example 9 : Self-Evolution

Assume user provide a “乘法加總問題” question structure. Original production rule QRP of ”乘法加總問題” is:

乘法加總問題→樹的總數,樹的價錢,樹的總價’, where “樹的總數” and “樹的 價錢” are variable type , and “樹的總價’ ” is question statement.

New production rule QRPof ”乘法加總問題”after self-evolution be applied is :

乘法加總問題→ 樹的總數,樹的價錢,樹的總價’| 樹的總數’,樹的價錢,樹的

總價 | 樹的總數,樹的價錢’,樹的總價.

The two production rules, which are 樹的總數’,樹的價錢,樹的總價 and 樹的總 數,樹的價錢’,樹的總價 will be added in production rule QRP automatically after self-evolution be applied.

The arithmetic word problem generated from production rule 乘法加總問題→

樹的總數,樹的價錢,樹的總價’ is:

“樹 100 顆,每顆樹 50 元,請問總共多少元?”.

The arithmetic word problem generated from production rule 乘法加總問題→

樹的總數’,樹的價錢,樹的總價 is :

“每顆樹 50 元,總共 5000 元,請問樹多少顆?”.

The arithmetic word problem generated from production rule 乘法加總問題→

樹的總數,樹的價錢’,樹的總價 is :

“樹 100 顆,總共 5000 元,請問每顆樹多少元?”.

3.5.3 Collaborative-Evolution

It is possible that the same atomic proposition in different propositional logic statements; in other words, there exists a variable type question requirement involved in different question structures. The different propositional logic statements can be integrated into a new propositional logic statement, which means two arithmetic word problems can be integrated into a new arithmetic word problem. Collaborative-evolution is to integrate two question structures with the same variable type question requirement into a new question structure. We can

add new production rules generated via collaborative-evolution into QSP of these two question structure. Figure 8 illustrates the concept of Collaborative-evolution.

Figure 8 Collaborative-evolution

If a variable type question requirementappearedin two question structures of different sub-problem categories then add new production rules in production rule QSP of these two question structures.

Assume there two question structures, QS1→QRV1 QRV2 QRV’3 in Sub-problem category B1 and QS2→QRV’3 QRV4 QRV5 in sub-problem category B2, Then add new production rule in production rule QSP of these two question structures.

B1→QSnew B2→QSnew

QSnew →QRV1 QRV2 QRV4 QRV5

QRV appears in both QS1 and QS2 will be discarded first, and then can be integrated into a QSnew.

Assume QS1 is a multiplication problem “A × B = C” from sub-problem category B1, its production rule is QS1→QRV1 QRV2 QRV’3. And the other, QS2 is an addition problem “C + D = E” from sub-problem category B2, its production rule is QS2→QRV3 QRV4 QRV’5. Because of QRV3 appears in both question structures, so we discard QRV3 and integrate QS1 and QS2 to generate a new

question structure. Because QS1 and QS2 belong to different sub-problem categories, we add new production rules, which are:

B1→QSnew B2→QSnew

QSnew →QRV1 QRV2 QRV4 QRV5

QSnew ,which is integrated with QS1 and QS2. After QSnew apply Self-Evolution, the problems of QSnew are :

“? × B + D = E”. structure from sub-problem category B1, its production rule is :

乘法加總問題→ 樹的總數’,樹的價錢,樹的總價, where “樹的總價” and “樹 的價錢” are variable type , and “樹的總數’ ” is question statement.

And the other, is ”兩端種樹問題”question structure from sub-problem category B2, its production rule is :

兩端種樹問題→樹的總數’,路旁種法,樹的間隔,兩端種法,路長, where”樹的總 數”, ”樹的間隔” are variable type question requirements, “路旁種法”, “兩端種 法”, is fix type question requirements, and ”樹的總數’ “is question statement.

Because of the variable type question requirement, ”樹的總數’ ” appears in both question structures, so we discard”樹的總數’ ”and integrate ”乘法加總問題”

and ”兩端種樹問題” to generate a new question structure. Because of “乘法加總 問題” and “兩端種樹問題”is belong in different sub-problem category, so we add new production rules, which are :

B1→QSnew

B2→QSnew

QSnew →樹的價錢,樹的總價,路旁種法,樹的間隔,兩端種法,路長

We could generate QSnew with this new production rule, which is integrated with QS1 and QS2. After QSnew apply Self-Evolution, the production rule QRP of QSnew

We could generate QSnew with this new production rule, which is integrated with QS1 and QS2. After QSnew apply Self-Evolution, the production rule QRP of QSnew

相關文件