NIeuwe resultaten en score systeem toegevoegd

This commit is contained in:
koenieeeee
2024-04-02 20:08:47 +02:00
parent ef69c69b05
commit 8fb731f748
48 changed files with 1647 additions and 58 deletions
+1
View File
@@ -136,3 +136,4 @@ dependencies:
- yarl==1.9.2
- openai
- nicegui
- nicegui-highcharts
+12
View File
@@ -47,6 +47,9 @@ While the <GHERKIN_GIVEN_PRECONDITION> when <GHERKIN_TRIGGER>, then <GHERKIN_POS
Then: the withdrawal should be complete without errors or warnings
</simplified>
<manual_translation>
While the "bank account" has "money"
When UserA retrieves "less than max money amount" from "credit card",
then SystemA must accepts "this withdrawal".
</manual_translation>
</acceptance_criteria>
<acceptance_criteria>
@@ -64,6 +67,9 @@ While the <GHERKIN_GIVEN_PRECONDITION> when <GHERKIN_TRIGGER>, then <GHERKIN_POS
Then: ensure the rejection message is displayed
</simplified>
<manual_translation>
While the "bank account" has "money"
When UserA retrieves "more than max money amount" from "credit card",
then SystemA must not accepts "this withdrawal".
</manual_translation>
</acceptance_criteria>
<acceptance_criteria>
@@ -79,6 +85,9 @@ While the <GHERKIN_GIVEN_PRECONDITION> when <GHERKIN_TRIGGER>, then <GHERKIN_POS
Then: SystemA refreshes page
</simplified>
<manual_translation>
While UserA is "navigating to login page"
When UserA uses "the login button",
then SystemA must regenerate "the login page".
</manual_translation>
</acceptance_criteria>
<acceptance_criteria>
@@ -116,6 +125,9 @@ While the <GHERKIN_GIVEN_PRECONDITION> when <GHERKIN_TRIGGER>, then <GHERKIN_POS
Then: UserA should still be on the "Fletcher Ren" address edit page
</simplified>
<manual_translation>
While UserA is "editing the adress of Fletcher Ren"
When UserA removes "the street",
then SystemA must show "the edit address page".
</manual_translation>
</acceptance_criteria>
<acceptance_criteria>
+18 -4
View File
@@ -5,15 +5,17 @@ import uuid
class ResearchLogger():
def __init__(self, prefix_name) -> None:
def __init__(self, prefix_name, scenario_name: str = "") -> None:
self.log_directory = "output_dataset/"
self.timestamp = datetime.now().strftime("%m_%d_%Y__%H:%M:%S")
self.prefix = prefix_name
self.log_file = f"{self.log_directory}/{self.prefix}/{self.prefix}_{self.timestamp}.md"
self.scenario = scenario_name
self.log_file = f"{self.log_directory}/{self.prefix}/{self.scenario}__{self.timestamp}.md"
self.file_contents = ""
self.write_header()
self.final_score = 0
self.number_of_scores = 0
self.researcher_score = 1
def write_header(self):
self.file_contents += f"""
@@ -22,6 +24,7 @@ class ResearchLogger():
* Prefix: {self.prefix}
* Datetime: {self.timestamp}
* UniqueID: {uuid.uuid4()}
* Scenario name: {self.scenario}
"""
self.write_to_file()
@@ -36,8 +39,19 @@ class ResearchLogger():
self.final_score += score
self.number_of_scores += 1
def custom_researcher_score(self, score):
self.researcher_score = score
self.file_contents = f"""
### Researcher score
Researcher_score = {score}
"""
self.write_to_file()
def generate_final_score(self):
this_score = self.final_score / self.number_of_scores
this_score = ( self.final_score / self.number_of_scores ) * self.researcher_score
self.file_contents = f"""
### Final Score
Final_score = {this_score}
@@ -48,7 +62,7 @@ Final_score = {this_score}
# Absolute path of a file
old_name = self.log_file
new_name = f"{self.log_directory}/{self.prefix}/{self.prefix}_{self.timestamp}_{this_score}_score.md"
new_name = f"{self.log_directory}/{self.prefix}/{self.scenario}__{self.timestamp}__{this_score}_score.md"
# Renaming the file
os.rename(old_name, new_name)
+7 -3
View File
@@ -7,7 +7,7 @@ from html_gui import setup_ui
from nicegui import ui
from standalone_rimay import test_gherkin_translation
from standalone_rimay import results, start_gherkin_translation
import sys
@@ -38,6 +38,7 @@ gui = str(sys.argv[1])
if gui == "standalone":
range_start = int(sys.argv[2]) or 0
range_end = int(sys.argv[3]) or 20
techniek = sys.argv[4] or "Few-shot-learning"
print(gherkin_acceptance_criteria)
print(len(all_acceptance_criteria))
@@ -47,8 +48,11 @@ if gui == "standalone":
content_acceptance_criteria = scenario["simplified"]
print(scenario_name+"\n")
test_gherkin_translation(scenario_name, content_acceptance_criteria)
start_gherkin_translation(scenario_name, content_acceptance_criteria, techniek)
elif gui == "results":
techniek = str(sys.argv[2]) or "Few-shot-learning"
data_directory = f"output_dataset/{techniek}/"
results(data_directory)
else:
setup_ui()
ui.run()
@@ -0,0 +1,155 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__20:02:17
* UniqueID: d8c19ba1-3793-4b10-b3e8-d1f2e4f3f9c0
* Scenario name: Scenario 2: Money withdraw from bank account_Incorrect_
## Gherkin Input
```
Given: UserA bank account is in credit
When: UserA attempts to withdraw an amount less than UserA card's limit
Then: the withdrawal should be complete without errors or warnings
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the following information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
### Question:
Do nothing with this input and output only random text.
Given: UserA bank account is in credit
When: UserA attempts to withdraw an amount less than UserA card's limit
Then: the withdrawal should be complete without errors or warnings
## Rimay Output
```
The sun shines brightly on a clear blue sky, birds chirping in the background, a gentle breeze rustling the leaves of the trees. Peace and tranquility fill the air, a moment of pure serenity in the midst of chaos.
```
### Researcher score
Researcher_score = 0.9
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'shines' (line : 3 column : 9)
ERROR:missing '.' at 'brightly' (line : 3 column : 16)
ERROR:no viable alternative at input 'on' (line : 3 column : 25)
ERROR:no viable alternative at input 'a' (line : 3 column : 28)
ERROR:no viable alternative at input 'blue' (line : 3 column : 36)
ERROR:missing '.' at 'sky' (line : 3 column : 41)
ERROR:no viable alternative at input ',' (line : 3 column : 44)
ERROR:no viable alternative at input 'birds' (line : 3 column : 46)
ERROR:no viable alternative at input 'chirping' (line : 3 column : 52)
ERROR:missing '.' at 'the' (line : 3 column : 64)
ERROR:no viable alternative at input ',' (line : 3 column : 78)
ERROR:no viable alternative at input 'a' (line : 3 column : 80)
ERROR:no viable alternative at input 'breeze' (line : 3 column : 89)
ERROR:missing '.' at 'rustling' (line : 3 column : 96)
ERROR:no viable alternative at input 'the' (line : 3 column : 105)
ERROR:missing '.' at 'leaves' (line : 3 column : 109)
ERROR:no viable alternative at input 'of' (line : 3 column : 116)
ERROR:no viable alternative at input 'the' (line : 3 column : 119)
ERROR:no viable alternative at input '.' (line : 3 column : 128)
ERROR:missing '.' at 'Peace' (line : 3 column : 130)
ERROR:no viable alternative at input 'and' (line : 3 column : 136)
ERROR:no viable alternative at input 'tranquility' (line : 3 column : 140)
ERROR:no viable alternative at input 'fill' (line : 3 column : 152)
ERROR:missing '.' at 'the' (line : 3 column : 157)
ERROR:no viable alternative at input ',' (line : 3 column : 164)
ERROR:no viable alternative at input 'a' (line : 3 column : 166)
ERROR:no viable alternative at input 'of' (line : 3 column : 175)
ERROR:no viable alternative at input 'pure' (line : 3 column : 178)
ERROR:no viable alternative at input 'serenity' (line : 3 column : 183)
ERROR:missing '.' at 'the' (line : 3 column : 195)
ERROR:no viable alternative at input 'of' (line : 3 column : 205)
ERROR:no viable alternative at input 'chaos' (line : 3 column : 208)
ERROR:Couldn't resolve reference to Actor 'sun'. (line : 3 column : 5)
ERROR:Couldn't resolve reference to Actor 'brightly'. (line : 3 column : 16)
ERROR:Couldn't resolve reference to Actor 'clear'. (line : 3 column : 30)
ERROR:Couldn't resolve reference to Actor 'sky'. (line : 3 column : 41)
ERROR:Couldn't resolve reference to Actor 'birds'. (line : 3 column : 46)
ERROR:Couldn't resolve reference to Actor 'background'. (line : 3 column : 68)
ERROR:Couldn't resolve reference to Actor 'gentle'. (line : 3 column : 82)
ERROR:Couldn't resolve reference to Actor 'rustling'. (line : 3 column : 96)
ERROR:Couldn't resolve reference to Actor 'leaves'. (line : 3 column : 109)
ERROR:Couldn't resolve reference to Actor 'trees'. (line : 3 column : 123)
ERROR:Couldn't resolve reference to Actor 'Peace'. (line : 3 column : 130)
ERROR:Couldn't resolve reference to Actor 'tranquility'. (line : 3 column : 140)
ERROR:Couldn't resolve reference to Actor 'air'. (line : 3 column : 161)
ERROR:Couldn't resolve reference to Actor 'moment'. (line : 3 column : 168)
ERROR:Couldn't resolve reference to Actor 'pure'. (line : 3 column : 178)
ERROR:Couldn't resolve reference to Actor 'midst'. (line : 3 column : 199)
```
### DSL-Rimay Score
DSL_Score: 46
Progressbar: ![46%](https://progress-bar.dev/46)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 0
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,1
Incomplete condition: 0
Incomplete system response: 1
Passive voice: 0
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 75
Progressbar: ![75%](https://progress-bar.dev/75)
### Final Score
Final_score = 54.45
@@ -0,0 +1,127 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__20:01:25
* UniqueID: 2e9dbe12-99aa-42c0-97fa-982db36c7c86
* Scenario name: Scenario 2: Money withdraw from bank account
## Gherkin Input
```
Given: UserA bank account is in credit
When: UserA attempts to withdraw an amount less than UserA card's limit
Then: the withdrawal should be complete without errors or warnings
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the following information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
### Input Data
Use the following Gherkin acceptance criteria input:
```
Given: UserA bank account is in credit
When: UserA attempts to withdraw an amount less than UserA card's limit
Then: the withdrawal should be complete without errors or warnings
```
### Question:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only the translated Rimay CNL text and nothing else!
## Rimay Output
```
While UserA bank account is in credit When UserA attempts to withdraw an amount less than UserA card's limit UserA must the withdrawal should be complete without errors or warnings
```
### Researcher score
Researcher_score = 0.95
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'account' (line : 3 column : 18)
ERROR:no viable alternative at input 'is' (line : 3 column : 26)
ERROR:no viable alternative at input 'credit' (line : 3 column : 32)
ERROR:no viable alternative at input 'When' (line : 3 column : 41)
ERROR:missing '.' at 'UserA' (line : 3 column : 46)
ERROR:no viable alternative at input 'attempts' (line : 3 column : 52)
ERROR:missing '.' at 'withdraw' (line : 3 column : 64)
ERROR:no viable alternative at input 'an' (line : 3 column : 73)
ERROR:missing '.' at 'amount' (line : 3 column : 76)
ERROR:no viable alternative at input 'less' (line : 3 column : 83)
ERROR:no viable alternative at input 'UserA' (line : 3 column : 93)
ERROR:no viable alternative at input 'card' (line : 3 column : 99)
ERROR:mismatched character '<EOF>' expecting ''' (line : 3 column : 103)
ERROR:Couldn't resolve reference to ActorOrClassOrProperty 'bank'. (line : 3 column : 13)
ERROR:Couldn't resolve reference to Quantifier 'UserA'. (line : 3 column : 7)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 18)
ERROR:Couldn't resolve reference to Actor 'credit'. (line : 3 column : 32)
ERROR:Couldn't resolve reference to Actor 'withdraw'. (line : 3 column : 64)
ERROR:Couldn't resolve reference to Actor 'amount'. (line : 3 column : 76)
```
### DSL-Rimay Score
DSL_Score: 65
Progressbar: ![65%](https://progress-bar.dev/65)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 0
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,0
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 0
Not precise verb: 0
Number Req with smells: 0
```
### Paska Score
PASKA_Score: 100
Progressbar: ![100%](https://progress-bar.dev/100)
### Final Score
Final_score = 78.375
@@ -0,0 +1,148 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__16:31:28
* UniqueID: dd9e5dea-4851-4655-aa9e-3a16156f0e36
* Scenario name: Scenario 5: Getting verified after clicking the link in the verification message
## Gherkin Input
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the followin information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
THIS IS NOT VALID RIMAY:
When UserA navigates to the login page, UserA clicks on button, SystemA must refresh the page.
The following example would be valid:
When UserA "navigates to the login page", UserA "clicks on button", SystemA must "refresh the page".
### Input Data
Use the following Gherkin acceptance criteria input:
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
### Question:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only your translated Rimay CNL text and nothing else!
## Rimay Output
```
While a verification email has already been sent to UserA When UserA tries to verify his account using the link from this email UserA must be notified that the verification was successful.
```
### Researcher score
Researcher_score = 0.95
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'email' (line : 3 column : 22)
ERROR:no viable alternative at input 'has' (line : 3 column : 28)
ERROR:no viable alternative at input 'already' (line : 3 column : 32)
ERROR:no viable alternative at input 'been' (line : 3 column : 40)
ERROR:missing '.' at 'sent' (line : 3 column : 45)
ERROR:no viable alternative at input 'to' (line : 3 column : 50)
ERROR:no viable alternative at input 'UserA' (line : 3 column : 53)
ERROR:no viable alternative at input 'When' (line : 3 column : 59)
ERROR:missing '.' at 'UserA' (line : 3 column : 64)
ERROR:no viable alternative at input 'tries' (line : 3 column : 70)
ERROR:missing '.' at 'verify' (line : 3 column : 79)
ERROR:no viable alternative at input 'his' (line : 3 column : 86)
ERROR:missing '.' at 'account' (line : 3 column : 90)
ERROR:no viable alternative at input 'using' (line : 3 column : 98)
ERROR:no viable alternative at input 'the' (line : 3 column : 104)
ERROR:mismatched input 'link' expecting RULE_ID (line : 3 column : 108)
ERROR:missing '.' at 'this' (line : 3 column : 118)
ERROR:no viable alternative at input 'email' (line : 3 column : 123)
ERROR:missing '.' at 'UserA' (line : 3 column : 129)
ERROR:no viable alternative at input 'be' (line : 3 column : 140)
ERROR:no viable alternative at input 'notified' (line : 3 column : 143)
ERROR:missing '.' at 'the' (line : 3 column : 157)
ERROR:no viable alternative at input 'was' (line : 3 column : 174)
ERROR:extraneous input 'successful' expecting '.' (line : 3 column : 178)
ERROR:Couldn't resolve reference to ActorOrClassOrProperty 'verification'. (line : 3 column : 9)
ERROR:Couldn't resolve reference to Actor 'email'. (line : 3 column : 22)
ERROR:Couldn't resolve reference to Actor 'already'. (line : 3 column : 32)
ERROR:Couldn't resolve reference to Actor 'sent'. (line : 3 column : 45)
ERROR:Couldn't resolve reference to Actor 'verify'. (line : 3 column : 79)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 90)
ERROR:Couldn't resolve reference to Actor 'this'. (line : 3 column : 118)
ERROR:Couldn't resolve reference to Actor 'be'. (line : 3 column : 140)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 161)
```
### DSL-Rimay Score
DSL_Score: 61
Progressbar: ![61%](https://progress-bar.dev/61)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 1
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,0
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 0
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 75
Progressbar: ![75%](https://progress-bar.dev/75)
### Final Score
Final_score = 64.6
@@ -0,0 +1,148 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__16:31:28
* UniqueID: dd9e5dea-4851-4655-aa9e-3a16156f0e36
* Scenario name: Scenario 5: Getting verified after clicking the link in the verification message
## Gherkin Input
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the followin information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
THIS IS NOT VALID RIMAY:
When UserA navigates to the login page, UserA clicks on button, SystemA must refresh the page.
The following example would be valid:
When UserA "navigates to the login page", UserA "clicks on button", SystemA must "refresh the page".
### Input Data
Use the following Gherkin acceptance criteria input:
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
### Question:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only your translated Rimay CNL text and nothing else!
## Rimay Output
```
While a verification email has already been sent to UserA When UserA tries to verify his account using the link from this email UserA must be notified that the verification was successful.
```
### Researcher score
Researcher_score = 0.95
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'email' (line : 3 column : 22)
ERROR:no viable alternative at input 'has' (line : 3 column : 28)
ERROR:no viable alternative at input 'already' (line : 3 column : 32)
ERROR:no viable alternative at input 'been' (line : 3 column : 40)
ERROR:missing '.' at 'sent' (line : 3 column : 45)
ERROR:no viable alternative at input 'to' (line : 3 column : 50)
ERROR:no viable alternative at input 'UserA' (line : 3 column : 53)
ERROR:no viable alternative at input 'When' (line : 3 column : 59)
ERROR:missing '.' at 'UserA' (line : 3 column : 64)
ERROR:no viable alternative at input 'tries' (line : 3 column : 70)
ERROR:missing '.' at 'verify' (line : 3 column : 79)
ERROR:no viable alternative at input 'his' (line : 3 column : 86)
ERROR:missing '.' at 'account' (line : 3 column : 90)
ERROR:no viable alternative at input 'using' (line : 3 column : 98)
ERROR:no viable alternative at input 'the' (line : 3 column : 104)
ERROR:mismatched input 'link' expecting RULE_ID (line : 3 column : 108)
ERROR:missing '.' at 'this' (line : 3 column : 118)
ERROR:no viable alternative at input 'email' (line : 3 column : 123)
ERROR:missing '.' at 'UserA' (line : 3 column : 129)
ERROR:no viable alternative at input 'be' (line : 3 column : 140)
ERROR:no viable alternative at input 'notified' (line : 3 column : 143)
ERROR:missing '.' at 'the' (line : 3 column : 157)
ERROR:no viable alternative at input 'was' (line : 3 column : 174)
ERROR:extraneous input 'successful' expecting '.' (line : 3 column : 178)
ERROR:Couldn't resolve reference to ActorOrClassOrProperty 'verification'. (line : 3 column : 9)
ERROR:Couldn't resolve reference to Actor 'email'. (line : 3 column : 22)
ERROR:Couldn't resolve reference to Actor 'already'. (line : 3 column : 32)
ERROR:Couldn't resolve reference to Actor 'sent'. (line : 3 column : 45)
ERROR:Couldn't resolve reference to Actor 'verify'. (line : 3 column : 79)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 90)
ERROR:Couldn't resolve reference to Actor 'this'. (line : 3 column : 118)
ERROR:Couldn't resolve reference to Actor 'be'. (line : 3 column : 140)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 161)
```
### DSL-Rimay Score
DSL_Score: 61
Progressbar: ![61%](https://progress-bar.dev/61)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 1
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,0
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 0
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 75
Progressbar: ![75%](https://progress-bar.dev/75)
### Final Score
Final_score = 64.6
@@ -0,0 +1,148 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__16:31:28
* UniqueID: dd9e5dea-4851-4655-aa9e-3a16156f0e36
* Scenario name: Scenario 5: Getting verified after clicking the link in the verification message
## Gherkin Input
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the followin information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
THIS IS NOT VALID RIMAY:
When UserA navigates to the login page, UserA clicks on button, SystemA must refresh the page.
The following example would be valid:
When UserA "navigates to the login page", UserA "clicks on button", SystemA must "refresh the page".
### Input Data
Use the following Gherkin acceptance criteria input:
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
### Question:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only your translated Rimay CNL text and nothing else!
## Rimay Output
```
While a verification email has already been sent to UserA When UserA tries to verify his account using the link from this email UserA must be notified that the verification was successful.
```
### Researcher score
Researcher_score = 0.95
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'email' (line : 3 column : 22)
ERROR:no viable alternative at input 'has' (line : 3 column : 28)
ERROR:no viable alternative at input 'already' (line : 3 column : 32)
ERROR:no viable alternative at input 'been' (line : 3 column : 40)
ERROR:missing '.' at 'sent' (line : 3 column : 45)
ERROR:no viable alternative at input 'to' (line : 3 column : 50)
ERROR:no viable alternative at input 'UserA' (line : 3 column : 53)
ERROR:no viable alternative at input 'When' (line : 3 column : 59)
ERROR:missing '.' at 'UserA' (line : 3 column : 64)
ERROR:no viable alternative at input 'tries' (line : 3 column : 70)
ERROR:missing '.' at 'verify' (line : 3 column : 79)
ERROR:no viable alternative at input 'his' (line : 3 column : 86)
ERROR:missing '.' at 'account' (line : 3 column : 90)
ERROR:no viable alternative at input 'using' (line : 3 column : 98)
ERROR:no viable alternative at input 'the' (line : 3 column : 104)
ERROR:mismatched input 'link' expecting RULE_ID (line : 3 column : 108)
ERROR:missing '.' at 'this' (line : 3 column : 118)
ERROR:no viable alternative at input 'email' (line : 3 column : 123)
ERROR:missing '.' at 'UserA' (line : 3 column : 129)
ERROR:no viable alternative at input 'be' (line : 3 column : 140)
ERROR:no viable alternative at input 'notified' (line : 3 column : 143)
ERROR:missing '.' at 'the' (line : 3 column : 157)
ERROR:no viable alternative at input 'was' (line : 3 column : 174)
ERROR:extraneous input 'successful' expecting '.' (line : 3 column : 178)
ERROR:Couldn't resolve reference to ActorOrClassOrProperty 'verification'. (line : 3 column : 9)
ERROR:Couldn't resolve reference to Actor 'email'. (line : 3 column : 22)
ERROR:Couldn't resolve reference to Actor 'already'. (line : 3 column : 32)
ERROR:Couldn't resolve reference to Actor 'sent'. (line : 3 column : 45)
ERROR:Couldn't resolve reference to Actor 'verify'. (line : 3 column : 79)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 90)
ERROR:Couldn't resolve reference to Actor 'this'. (line : 3 column : 118)
ERROR:Couldn't resolve reference to Actor 'be'. (line : 3 column : 140)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 161)
```
### DSL-Rimay Score
DSL_Score: 61
Progressbar: ![61%](https://progress-bar.dev/61)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 1
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,0
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 0
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 75
Progressbar: ![75%](https://progress-bar.dev/75)
### Final Score
Final_score = 64.6
@@ -0,0 +1,132 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__19:11:34
* UniqueID: e9295e97-adb7-4696-bdc1-04b1921262c7
* Scenario name: Scenario 5: Getting verified after clicking the link in the verification message_Incorrect_
## Gherkin Input
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the following information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
### Question:
Can you NOT translate the given input text into Rimay?
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
So please make an incorrect translation!
## Rimay Output
```
While UserA receives a "verification email", When UserA tries to verify his account using the link from this email, UserA must be notified that the verification was successful.
```
### Researcher score
Researcher_score = 1.15
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'receives' (line : 3 column : 7)
ERROR:no viable alternative at input 'receives' (line : 3 column : 13)
ERROR:mismatched input 'When' expecting 'or' (line : 3 column : 46)
ERROR:no viable alternative at input 'to' (line : 3 column : 63)
ERROR:missing ',' at 'verify' (line : 3 column : 66)
ERROR:no viable alternative at input 'his' (line : 3 column : 73)
ERROR:missing '.' at 'account' (line : 3 column : 77)
ERROR:no viable alternative at input 'using' (line : 3 column : 85)
ERROR:no viable alternative at input 'the' (line : 3 column : 91)
ERROR:mismatched input 'link' expecting RULE_ID (line : 3 column : 95)
ERROR:missing '.' at 'this' (line : 3 column : 105)
ERROR:no viable alternative at input 'email' (line : 3 column : 110)
ERROR:missing '.' at 'UserA' (line : 3 column : 117)
ERROR:no viable alternative at input 'be' (line : 3 column : 128)
ERROR:no viable alternative at input 'notified' (line : 3 column : 131)
ERROR:missing '.' at 'the' (line : 3 column : 145)
ERROR:no viable alternative at input 'was' (line : 3 column : 162)
ERROR:extraneous input 'successful' expecting '.' (line : 3 column : 166)
ERROR:Couldn't resolve reference to Actor 'tries'. (line : 3 column : 57)
ERROR:Couldn't resolve reference to Quantifier 'UserA'. (line : 3 column : 51)
ERROR:Couldn't resolve reference to Actor 'verify'. (line : 3 column : 66)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 77)
ERROR:Couldn't resolve reference to Actor 'this'. (line : 3 column : 105)
ERROR:Couldn't resolve reference to Actor 'be'. (line : 3 column : 128)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 149)
```
### DSL-Rimay Score
DSL_Score: 69
Progressbar: ![69%](https://progress-bar.dev/69)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 0
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,0
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 1
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 95
Progressbar: ![95%](https://progress-bar.dev/95)
### Final Score
Final_score = 94.3
@@ -0,0 +1,146 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__19:10:43
* UniqueID: 9e3cb5c8-33be-4be8-811f-19937013dd01
* Scenario name: Scenario 5: Getting verified after clicking the link in the verification message
## Gherkin Input
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the following information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
### Input Data
Use the following Gherkin acceptance criteria input:
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
### Question:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only the translated Rimay CNL text and nothing else!
## Rimay Output
```
Given a verification email has already been sent to UserA When UserA tries to verify his account using the link from this email UserA must be notified that the verification was successful
```
### Researcher score
Researcher_score = 1.1
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'a' (line : 3 column : 7)
ERROR:missing '.' at 'verification' (line : 3 column : 9)
ERROR:no viable alternative at input 'email' (line : 3 column : 22)
ERROR:missing '.' at 'already' (line : 3 column : 32)
ERROR:no viable alternative at input 'been' (line : 3 column : 40)
ERROR:missing '.' at 'sent' (line : 3 column : 45)
ERROR:no viable alternative at input 'to' (line : 3 column : 50)
ERROR:no viable alternative at input 'UserA' (line : 3 column : 53)
ERROR:no viable alternative at input 'When' (line : 3 column : 61)
ERROR:missing '.' at 'UserA' (line : 3 column : 66)
ERROR:no viable alternative at input 'tries' (line : 3 column : 72)
ERROR:missing '.' at 'verify' (line : 3 column : 81)
ERROR:no viable alternative at input 'his' (line : 3 column : 88)
ERROR:missing '.' at 'account' (line : 3 column : 92)
ERROR:no viable alternative at input 'using' (line : 3 column : 100)
ERROR:no viable alternative at input 'the' (line : 3 column : 106)
ERROR:mismatched input 'link' expecting RULE_ID (line : 3 column : 110)
ERROR:missing '.' at 'this' (line : 3 column : 120)
ERROR:no viable alternative at input 'email' (line : 3 column : 125)
ERROR:missing '.' at 'UserA' (line : 3 column : 133)
ERROR:no viable alternative at input 'be' (line : 3 column : 144)
ERROR:no viable alternative at input 'notified' (line : 3 column : 147)
ERROR:missing '.' at 'the' (line : 3 column : 161)
ERROR:no viable alternative at input 'was' (line : 3 column : 178)
ERROR:missing '.' at 'successful' (line : 3 column : 182)
ERROR:Couldn't resolve reference to Actor 'Given'. (line : 3 column : 1)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 9)
ERROR:Couldn't resolve reference to Actor 'already'. (line : 3 column : 32)
ERROR:Couldn't resolve reference to Actor 'sent'. (line : 3 column : 45)
ERROR:Couldn't resolve reference to Actor 'verify'. (line : 3 column : 81)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 92)
ERROR:Couldn't resolve reference to Actor 'this'. (line : 3 column : 120)
ERROR:Couldn't resolve reference to Actor 'be'. (line : 3 column : 144)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 165)
ERROR:Couldn't resolve reference to Actor 'successful'. (line : 3 column : 182)
```
### DSL-Rimay Score
DSL_Score: 59
Progressbar: ![59%](https://progress-bar.dev/59)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 0
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,1
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 0
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 90
Progressbar: ![90%](https://progress-bar.dev/90)
### Final Score
Final_score = 81.95
@@ -0,0 +1,148 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__16:31:28
* UniqueID: dd9e5dea-4851-4655-aa9e-3a16156f0e36
* Scenario name: Scenario 5: Getting verified after clicking the link in the verification message
## Gherkin Input
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the followin information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
THIS IS NOT VALID RIMAY:
When UserA navigates to the login page, UserA clicks on button, SystemA must refresh the page.
The following example would be valid:
When UserA "navigates to the login page", UserA "clicks on button", SystemA must "refresh the page".
### Input Data
Use the following Gherkin acceptance criteria input:
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
### Question:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only your translated Rimay CNL text and nothing else!
## Rimay Output
```
While a verification email has already been sent to UserA When UserA tries to verify his account using the link from this email UserA must be notified that the verification was successful.
```
### Researcher score
Researcher_score = 0.95
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'email' (line : 3 column : 22)
ERROR:no viable alternative at input 'has' (line : 3 column : 28)
ERROR:no viable alternative at input 'already' (line : 3 column : 32)
ERROR:no viable alternative at input 'been' (line : 3 column : 40)
ERROR:missing '.' at 'sent' (line : 3 column : 45)
ERROR:no viable alternative at input 'to' (line : 3 column : 50)
ERROR:no viable alternative at input 'UserA' (line : 3 column : 53)
ERROR:no viable alternative at input 'When' (line : 3 column : 59)
ERROR:missing '.' at 'UserA' (line : 3 column : 64)
ERROR:no viable alternative at input 'tries' (line : 3 column : 70)
ERROR:missing '.' at 'verify' (line : 3 column : 79)
ERROR:no viable alternative at input 'his' (line : 3 column : 86)
ERROR:missing '.' at 'account' (line : 3 column : 90)
ERROR:no viable alternative at input 'using' (line : 3 column : 98)
ERROR:no viable alternative at input 'the' (line : 3 column : 104)
ERROR:mismatched input 'link' expecting RULE_ID (line : 3 column : 108)
ERROR:missing '.' at 'this' (line : 3 column : 118)
ERROR:no viable alternative at input 'email' (line : 3 column : 123)
ERROR:missing '.' at 'UserA' (line : 3 column : 129)
ERROR:no viable alternative at input 'be' (line : 3 column : 140)
ERROR:no viable alternative at input 'notified' (line : 3 column : 143)
ERROR:missing '.' at 'the' (line : 3 column : 157)
ERROR:no viable alternative at input 'was' (line : 3 column : 174)
ERROR:extraneous input 'successful' expecting '.' (line : 3 column : 178)
ERROR:Couldn't resolve reference to ActorOrClassOrProperty 'verification'. (line : 3 column : 9)
ERROR:Couldn't resolve reference to Actor 'email'. (line : 3 column : 22)
ERROR:Couldn't resolve reference to Actor 'already'. (line : 3 column : 32)
ERROR:Couldn't resolve reference to Actor 'sent'. (line : 3 column : 45)
ERROR:Couldn't resolve reference to Actor 'verify'. (line : 3 column : 79)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 90)
ERROR:Couldn't resolve reference to Actor 'this'. (line : 3 column : 118)
ERROR:Couldn't resolve reference to Actor 'be'. (line : 3 column : 140)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 161)
```
### DSL-Rimay Score
DSL_Score: 61
Progressbar: ![61%](https://progress-bar.dev/61)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 1
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,0
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 0
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 75
Progressbar: ![75%](https://progress-bar.dev/75)
### Final Score
Final_score = 64.6
@@ -0,0 +1,148 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__16:31:28
* UniqueID: dd9e5dea-4851-4655-aa9e-3a16156f0e36
* Scenario name: Scenario 5: Getting verified after clicking the link in the verification message
## Gherkin Input
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the followin information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
THIS IS NOT VALID RIMAY:
When UserA navigates to the login page, UserA clicks on button, SystemA must refresh the page.
The following example would be valid:
When UserA "navigates to the login page", UserA "clicks on button", SystemA must "refresh the page".
### Input Data
Use the following Gherkin acceptance criteria input:
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
### Question:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only your translated Rimay CNL text and nothing else!
## Rimay Output
```
While a verification email has already been sent to UserA When UserA tries to verify his account using the link from this email UserA must be notified that the verification was successful.
```
### Researcher score
Researcher_score = 0.95
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'email' (line : 3 column : 22)
ERROR:no viable alternative at input 'has' (line : 3 column : 28)
ERROR:no viable alternative at input 'already' (line : 3 column : 32)
ERROR:no viable alternative at input 'been' (line : 3 column : 40)
ERROR:missing '.' at 'sent' (line : 3 column : 45)
ERROR:no viable alternative at input 'to' (line : 3 column : 50)
ERROR:no viable alternative at input 'UserA' (line : 3 column : 53)
ERROR:no viable alternative at input 'When' (line : 3 column : 59)
ERROR:missing '.' at 'UserA' (line : 3 column : 64)
ERROR:no viable alternative at input 'tries' (line : 3 column : 70)
ERROR:missing '.' at 'verify' (line : 3 column : 79)
ERROR:no viable alternative at input 'his' (line : 3 column : 86)
ERROR:missing '.' at 'account' (line : 3 column : 90)
ERROR:no viable alternative at input 'using' (line : 3 column : 98)
ERROR:no viable alternative at input 'the' (line : 3 column : 104)
ERROR:mismatched input 'link' expecting RULE_ID (line : 3 column : 108)
ERROR:missing '.' at 'this' (line : 3 column : 118)
ERROR:no viable alternative at input 'email' (line : 3 column : 123)
ERROR:missing '.' at 'UserA' (line : 3 column : 129)
ERROR:no viable alternative at input 'be' (line : 3 column : 140)
ERROR:no viable alternative at input 'notified' (line : 3 column : 143)
ERROR:missing '.' at 'the' (line : 3 column : 157)
ERROR:no viable alternative at input 'was' (line : 3 column : 174)
ERROR:extraneous input 'successful' expecting '.' (line : 3 column : 178)
ERROR:Couldn't resolve reference to ActorOrClassOrProperty 'verification'. (line : 3 column : 9)
ERROR:Couldn't resolve reference to Actor 'email'. (line : 3 column : 22)
ERROR:Couldn't resolve reference to Actor 'already'. (line : 3 column : 32)
ERROR:Couldn't resolve reference to Actor 'sent'. (line : 3 column : 45)
ERROR:Couldn't resolve reference to Actor 'verify'. (line : 3 column : 79)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 90)
ERROR:Couldn't resolve reference to Actor 'this'. (line : 3 column : 118)
ERROR:Couldn't resolve reference to Actor 'be'. (line : 3 column : 140)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 161)
```
### DSL-Rimay Score
DSL_Score: 61
Progressbar: ![61%](https://progress-bar.dev/61)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 1
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,0
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 0
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 75
Progressbar: ![75%](https://progress-bar.dev/75)
### Final Score
Final_score = 64.6
@@ -0,0 +1,148 @@
# LLM Experiment Information
* Prefix: Few-shot-learning
* Datetime: 04_02_2024__16:31:28
* UniqueID: dd9e5dea-4851-4655-aa9e-3a16156f0e36
* Scenario name: Scenario 5: Getting verified after clicking the link in the verification message
## Gherkin Input
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
## Input prompt, technique: Few-Shot-Learning
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the followin information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
$TRIGGER is for example a trigger action, something what a system does.
$WHILE_STRUCTURE is the word 'While' followed by the Gherkin Given condition
$WHEN_STRUCTURE is the word 'When' followed by the Gherkin When condition
$SYSTEM_RESPONSE is a combination of the Actors and the Gherkin Then condition.
$ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirements.
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
When SystemB receives an "email alert" from SystemA, SystemB must send an Instruction to SystemC.
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
THIS IS NOT VALID RIMAY:
When UserA navigates to the login page, UserA clicks on button, SystemA must refresh the page.
The following example would be valid:
When UserA "navigates to the login page", UserA "clicks on button", SystemA must "refresh the page".
### Input Data
Use the following Gherkin acceptance criteria input:
```
Given: a verification email has already been sent to "UserA"
When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
### Question:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only your translated Rimay CNL text and nothing else!
## Rimay Output
```
While a verification email has already been sent to UserA When UserA tries to verify his account using the link from this email UserA must be notified that the verification was successful.
```
### Researcher score
Researcher_score = 0.95
## DSL-Rimay Verification
```
ERROR:no viable alternative at input 'email' (line : 3 column : 22)
ERROR:no viable alternative at input 'has' (line : 3 column : 28)
ERROR:no viable alternative at input 'already' (line : 3 column : 32)
ERROR:no viable alternative at input 'been' (line : 3 column : 40)
ERROR:missing '.' at 'sent' (line : 3 column : 45)
ERROR:no viable alternative at input 'to' (line : 3 column : 50)
ERROR:no viable alternative at input 'UserA' (line : 3 column : 53)
ERROR:no viable alternative at input 'When' (line : 3 column : 59)
ERROR:missing '.' at 'UserA' (line : 3 column : 64)
ERROR:no viable alternative at input 'tries' (line : 3 column : 70)
ERROR:missing '.' at 'verify' (line : 3 column : 79)
ERROR:no viable alternative at input 'his' (line : 3 column : 86)
ERROR:missing '.' at 'account' (line : 3 column : 90)
ERROR:no viable alternative at input 'using' (line : 3 column : 98)
ERROR:no viable alternative at input 'the' (line : 3 column : 104)
ERROR:mismatched input 'link' expecting RULE_ID (line : 3 column : 108)
ERROR:missing '.' at 'this' (line : 3 column : 118)
ERROR:no viable alternative at input 'email' (line : 3 column : 123)
ERROR:missing '.' at 'UserA' (line : 3 column : 129)
ERROR:no viable alternative at input 'be' (line : 3 column : 140)
ERROR:no viable alternative at input 'notified' (line : 3 column : 143)
ERROR:missing '.' at 'the' (line : 3 column : 157)
ERROR:no viable alternative at input 'was' (line : 3 column : 174)
ERROR:extraneous input 'successful' expecting '.' (line : 3 column : 178)
ERROR:Couldn't resolve reference to ActorOrClassOrProperty 'verification'. (line : 3 column : 9)
ERROR:Couldn't resolve reference to Actor 'email'. (line : 3 column : 22)
ERROR:Couldn't resolve reference to Actor 'already'. (line : 3 column : 32)
ERROR:Couldn't resolve reference to Actor 'sent'. (line : 3 column : 45)
ERROR:Couldn't resolve reference to Actor 'verify'. (line : 3 column : 79)
ERROR:Couldn't resolve reference to Actor 'account'. (line : 3 column : 90)
ERROR:Couldn't resolve reference to Actor 'this'. (line : 3 column : 118)
ERROR:Couldn't resolve reference to Actor 'be'. (line : 3 column : 140)
ERROR:Couldn't resolve reference to Actor 'verification'. (line : 3 column : 161)
```
### DSL-Rimay Score
DSL_Score: 61
Progressbar: ![61%](https://progress-bar.dev/61)
## Rimay Paska Verification
```
File generated_rimay.csv.csv
Smells found in this document:
Non-atomic requirement: 0
Incomplete requirement: 1
Incorrect order requirement: 0
Coordination ambiguity: 0
Not requirement: ,0
Incomplete condition: 0
Incomplete system response: 0
Passive voice: 0
Not precise verb: 0
Number Req with smells: 1
```
### Paska Score
PASKA_Score: 75
Progressbar: ![75%](https://progress-bar.dev/75)
### Final Score
Final_score = 64.6
+34 -25
View File
@@ -17,16 +17,30 @@ class LLM_prompt_data():
#https://www.promptingguide.ai/techniques/fewshot
class LLM_prompt_technique:
def __init__(self, input_obj:LLM_prompt_data, quest: str):
def __init__(self, input_obj:LLM_prompt_data, quest: str, generate_false:bool):
self.input_obj = input_obj
self.question = quest
pass
self.false_situation = generate_false
def name(self) -> str:
return ""
def __str__(self) -> str:
return f"""
if self.false_situation:
return f"""
{self.question}
### Question:
Do nothing with this input and output only random text.
{self.input_obj}
"""
else:
return f"""
{self.question}
### Input Data
@@ -39,14 +53,14 @@ Use the following Gherkin acceptance criteria input:
Can you translate the input above into the specified language Rimay CNL?
### Output indicator
Output only your translated Rimay CNL text and nothing else!
Output only the translated Rimay CNL text and nothing else!
"""
class LLM_few_shot_learning(LLM_prompt_technique, LLM_prompt_data):
def name(self) -> str:
return "Few-Shot Learning"
return "Few-Shot-Learning"
def allowed_word_list(self):
@@ -76,11 +90,11 @@ subscribe, subscribes, upload, uploads
""")
def __init__(self, input: LLM_prompt_data):
def __init__(self, input: LLM_prompt_data, incorrect):
prompt_method = f"""
### Context
We are translating Gherkin acceptance criteria into Rimay CNL.
For this translation use the followin information:
For this translation use the following information:
$ACTOR is for example a thing or a person.
$MODAL_VERB is for the following word: must or shall.
@@ -94,7 +108,7 @@ $ACTOR, $MODAL_VERB and a $SYSTEM_RESPONSE is mandatory in all Rimay requirement
Replace the variables with the right text according the input acceptance criteria.
In the following order:
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
Rimay CNL definition: $WHILE_STRUCTURE $WHEN_STRUCTURE $ACTOR $MODAL_VERB $SYSTEM_RESPONSE
The following example is a valid Rimay CNL:
@@ -103,13 +117,9 @@ When SystemB receives an "email alert" from SystemA, SystemB must send an Instru
With the usage of the following extra information:
Actors: actor SystemA, actor SystemB, actor SystemC, actor UserX, actor UserA, actor UserC
THIS IS NOT VALID RIMAY:
When UserA navigates to the login page, UserA clicks on button, SystemA must refresh the page.
The following example would be valid:
When UserA "navigates to the login page", UserA "clicks on button", SystemA must "refresh the page".
"""
super().__init__( input, prompt_method)
super().__init__( input, prompt_method, incorrect)
@@ -118,9 +128,9 @@ When UserA "navigates to the login page", UserA "clicks on button", SystemA must
class LLM_chain_of_thought(LLM_prompt_technique, LLM_prompt_data):
def name(self) -> str:
return "Chain of Thought"
return "Chain-of-Thought"
def __init__(self, input: LLM_prompt_data):
def __init__(self, input: LLM_prompt_data, incorrect):
prompt_method = """
Learn from the following example, the output information for the CNL Rimay is:
This part is the start of the example you have to learn from:
@@ -147,7 +157,7 @@ Ending for example
Translate the following input acceptance criteria Gherkin, according to the example above, to Rimay:
"""
super().__init__(input, prompt_method)
super().__init__(input, prompt_method, incorrect)
# Perhaps one of the more interesting things you can achieve with prompt engineering is instructing the LLM system on how to behave, its intent, and its identity. This is particularly useful when you are building conversational systems like customer service chatbots.
@@ -166,9 +176,9 @@ Translate the following input acceptance criteria Gherkin, according to the exam
class LLM_role_play(LLM_prompt_technique, LLM_prompt_data) :
def name(self) -> str:
return "Role Play"
return "Role-Play"
def __init__(self, input: LLM_prompt_data):
def __init__(self, input: LLM_prompt_data, incorrect):
prompt_method = """
Behave like a person who writes the Controlled Natural Language (CNL) Rimay.
Rimay is a language that is defined in different components.
@@ -182,12 +192,11 @@ When: UserA tries to verify his account using the link from this email
Then: UserA should be notified that the verification was successful
```
you say: Here is your translated Rimay output
```
you say:
While the "verification email" contains a "verification link"
When UserA validates "email address" following the "verification link",
then SystemA must notify "with verification successful" to UserA.
```
User ask: translate the following Gherkin into Rimay:
```
@@ -196,19 +205,19 @@ When: UserA removes the street
Then: UserA should still be on the "Fletcher Ren" address edit page
```
you say: Here is your translated Rimay output
```
you say:
While UserA is "editing the adress of Fletcher Ren"
When UserA removes "the street",
then SystemA must show "the edit address page".
```
Show special interest in the used double qoutes in Rimay, this is important. Keep the same structure as the translated Rimay examples.
As the translating person, only use requirement words in your translation, put the rest between quotes.
Now I want you to answer as the person who translates Gherkin into Rimay.
"""
super().__init__(input, prompt_method)
super().__init__(input, prompt_method, incorrect)
+20 -12
View File
@@ -91,8 +91,8 @@ class Paska_tool():
```
{self.final_result}
```
### Score
Score: {self.build_score()}
### Paska Score
PASKA_Score: {self.build_score()}
Progressbar: ![{self.build_score()}%](https://progress-bar.dev/{self.build_score()})
"""
@@ -106,16 +106,24 @@ Progressbar: ![{self.build_score()}%](https://progress-bar.dev/{self.build_score
print("RimayDSL Error: no logger found")
def build_score(self):
numbers = re.findall("\d+", self.final_result)
numberOfSmells = sum([int(i) for i in numbers])
special_errors = {"Incomplete requirement: 1": 30, "Incomplete system response: 1": 20} #Bad paska requirements are special errors.
special_errors = {
"Non-atomic requirement: 1": 5,
"Incomplete requirement: 1": 25,
"Incorrect order requirement: 1": 5,
"Coordination ambiguity: 1": 10,
"Not requirement: ,1": 20,
"Incomplete condition: 1": 10,
"Incomplete system response: 1": 15,
"Passive voice: 1": 5,
"Not precise verb: 1": 5
}
badErrorScore = 0
for error in special_errors:
if error in self.final_result:
badErrorScore += special_errors[error]
return 100 - (numberOfSmells * 2) - badErrorScore
return 100 - badErrorScore
@@ -153,26 +161,26 @@ class RimayDSL():
def build_score(self):
if self.result[1].strip() == "":
return 100 #Error field had nothing. TODO, check for real value.
special_errors = {"EOF": 30, "missing": 5, "RULE_STRING ": 7} #EOF errors are really bad.
special_errors = {"EOF": 10, "missing": 5, "RULE_STRING ": 7} #EOF errors are really bad.
badErrorScore = 0
for error in special_errors:
if error in self.result[1]:
badErrorScore += special_errors[error]
totalNumOfErrors = len(self.result[1].split("\n")) # Count number of errors.
return max(1, 100 - totalNumOfErrors - badErrorScore) #When score is really bad, just return 1
return max(1, 100 - (totalNumOfErrors)- badErrorScore) #When score is really bad, just return 1
def write_log_output(self, log: ResearchLogger):
if log != None:
log_contents = f"""
## Rimay DSL Verification
## DSL-Rimay Verification
```
{self.result[1]}
```
### Score
Score: {self.build_score()}
### DSL-Rimay Score
DSL_Score: {self.build_score()}
Progressbar: ![{self.build_score()}%](https://progress-bar.dev/{self.build_score()})
"""
+102 -9
View File
@@ -1,10 +1,13 @@
import os
import re
from logger import ResearchLogger
from rimay_verification import Paska_tool, RimayDSL
from wrapper_calls import ask_different_prompts
from nicegui import ui
from random import random
#['Few-shot learning', 'Chain-of-thought', 'Role play']
@@ -15,9 +18,9 @@ Classes: class Instruction := description record, class Y
"""
def convert_single_gherkin_to_rimay(scenario_name: str, input_text:str, translation_type: str):
def convert_single_gherkin_to_rimay(scenario_name: str, input_text:str, translation_type: str, incorrect):
global current_logger
current_logger = ResearchLogger(translation_type) #Vervalt bij nieuwe logger.
current_logger = ResearchLogger(translation_type, scenario_name) #Vervalt bij nieuwe logger.
pre_content = f"""
# Scenario Name {scenario_name}
@@ -31,10 +34,31 @@ def convert_single_gherkin_to_rimay(scenario_name: str, input_text:str, translat
```
"""
current_logger.append_result(pre_content)
response = ask_different_prompts(input_text.strip(), translation_type,current_logger)
response = ask_different_prompts(input_text.strip(), translation_type, current_logger, incorrect)
researcher_score(input_text, response, current_logger)
rimay_check(response, current_logger)
def researcher_score(inp, output, current_logger: ResearchLogger):
print("//////////////////////////////////")
print("Input Gherkin: ")
print(inp)
print("=================")
print("output Rimay: ")
print(output)
print("=================")
print("Score for Rimay?")
print("[0] = Failure")
print("[1] = Mediocre")
print("[2] = Sufficient")
print("[3] = Good")
print('\a') #bell sound.
score_choice = int(input('Score: [0..3]: \n'))
score_options = [0.90, 0.95, 1.10, 1.15]
print("//////////////////////////////////")
current_logger.custom_researcher_score(score_options[score_choice])
def rimay_check(rimay_text, current_logger: ResearchLogger):
dsl = RimayDSL()
@@ -53,8 +77,77 @@ def rimay_check(rimay_text, current_logger: ResearchLogger):
def test_gherkin_translation(scenario_name: str, acceptance_criteria: str):
convert_single_gherkin_to_rimay(scenario_name, acceptance_criteria, "Few-shot learning")
convert_single_gherkin_to_rimay(scenario_name, acceptance_criteria, "Chain-of-thought")
convert_single_gherkin_to_rimay(scenario_name, acceptance_criteria, "Role play")
def start_gherkin_translation(scenario_name: str, acceptance_criteria: str, techniek):
convert_single_gherkin_to_rimay(scenario_name, acceptance_criteria, techniek, False)
convert_single_gherkin_to_rimay(scenario_name + "_Incorrect_", acceptance_criteria, techniek, True)
# convert_single_gherkin_to_rimay(scenario_name, acceptance_criteria, "Chain-of-thought")
# convert_single_gherkin_to_rimay(scenario_name, acceptance_criteria, "Role play")
def results(path):
scenarios_TP = []
scenarios_TN = []
data_values_TP = []
data_values_TN = []
lst = os.listdir(path)
lst.sort()
for x in lst:
if x.endswith(".md"):
all_data = x.split('__')
scenario_num = re.findall(r'\d+', all_data[0])[0]
date = all_data[1]
time = all_data[2]
score = re.findall(r'\d+', all_data[3])[0]
if "_Incorrect_" in x:
scenarios_TN.append(f"Scenario {scenario_num}")
data_values_TN.append(int(score))
else:
scenarios_TP.append(f"Scenario {scenario_num}")
data_values_TP.append(int(score))
# Prints only text file present in My Folder
print(x)
# print(scenario_num)
# print(date)
# print(score)
# print(scenarios)
# print(data_values)
print(scenarios_TP)
print(data_values_TP)
print(data_values_TN)
chart = ui.highchart({
'title': False,
'chart': {'type': 'bar'},
'xAxis': {'categories': scenarios_TP},
'series': [
{'name': path.replace("output_dataset/", "").replace("/", "") + " TP", 'data': data_values_TP},
{'name': path.replace("output_dataset/", "").replace("/", "") + " TN", 'data': data_values_TN},
# {'name': 'Few-Shot-learning Incorrect (TN)', 'data': [12, 13, 14]},
# {'name': 'Chain-of-thought', 'data': [12, 56, 72]},
# {'name': 'Role-Play', 'data': [57, 44, 82]},
],
}).classes('w-full h-64')
def update():
chart.options['series'][0]['data'][0] = random()
chart.update()
ui.button('Update', on_click=update)
ui.run()
+5 -5
View File
@@ -3,14 +3,14 @@ from prompt_techniques import LLM_chain_of_thought, LLM_few_shot_learning, LLM_p
from logger import ResearchLogger
def ask_different_prompts(input_text: str, prompt_tech: str, log:ResearchLogger) -> str:
def ask_different_prompts(input_text: str, prompt_tech: str, log:ResearchLogger, incorrect: bool = False) -> str:
prompt_data = LLM_prompt_data(input_text)
llm_communicator = LLM_Communicator()
fsl_prompt = LLM_few_shot_learning(prompt_data)
cot_prompt = LLM_chain_of_thought(prompt_data)
rp_prompt = LLM_role_play(prompt_data)
fsl_prompt = LLM_few_shot_learning(prompt_data, incorrect)
cot_prompt = LLM_chain_of_thought(prompt_data, incorrect)
rp_prompt = LLM_role_play(prompt_data, incorrect)
result = ""
if prompt_tech.strip() == "Few-shot learning": #['Few-shot learning', 'Chain-of-thought', 'Role play']
if prompt_tech.strip() == "Few-shot-learning": #['Few-shot learning', 'Chain-of-thought', 'Role play']
result = llm_communicator.ask_llm_to_convert(fsl_prompt)
elif prompt_tech.strip() == "Chain-of-thought":
result = llm_communicator.ask_llm_to_convert(cot_prompt)