Skip to content

Commit

Permalink
Adjust prompts and apollon
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonWehrhahn committed Sep 20, 2024
1 parent 6538117 commit c70f1db
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ def resolve_references(self, element_dict: Dict[str, Any]):
self.attributes = [element_dict[ref].get("name", "") for ref in self.attribute_refs if ref in element_dict]
self.methods = [element_dict[ref].get('name', '') for ref in self.method_refs if ref in element_dict]

for ref_list, target_list in [(self.attribute_refs, self.attributes), (self.method_refs, self.methods)]:
target_list.extend(
element_dict.get(ref, {}).get("name", "") for ref in ref_list if ref in element_dict
)

def to_apollon(self) -> str:
parts = [f"[{self.type}] {self.name}"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ def _parse(self) -> None:
for element_data in self.data['elements'].values():
if element_data.get('id') not in referenced_ids:
name = element_data.get('name')
if name_count[name] > 1:
suffix_index = name_suffix_counters[name]
element_data['name'] = f"{name}{ascii_uppercase[suffix_index]}"
suffix_index = name_suffix_counters[name]

if name == '':
element_data['name'] = f"##{ascii_uppercase[suffix_index]}"
if name_count[name] > 1:
name_suffix_counters[name] += 1
elif name_count[name] > 1:
element_data['name'] = f"{name}#{ascii_uppercase[suffix_index]}"
name_suffix_counters[name] += 1

element = Element(element_data, self.data['elements'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ async def filter_feedback(
config: BasicApproachConfig,
debug: bool,
) -> AssessmentModel:

print(f"\n\n\n\n\n{original_feedback.json()}\n\n\n\n\n")

chat_prompt = ChatPromptTemplate.from_messages([
("system", config.generate_suggestions_prompt.filter_feedback_system_message),
Expand Down Expand Up @@ -45,4 +47,6 @@ async def filter_feedback(
if feedback_result is None:
raise ValueError("No feedback was returned by the model.")

print(f"\n\n\n\n\n{feedback_result.json()}\n\n\n\n\n")

return feedback_result

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
<ElementOwner>: [<elementName>]
```
##### Naming
When there are elements in the original diagram with the same name, the Apollon format appends a unique suffix to each duplicate name to ensure clarity and avoid ambiguity. This suffix can be identified by the `#` symbol followed by an uppercase letter.
When there are elements in the original diagram with no name, the Apollon format assignes them uppercase letters for the name. These can be identified by the `##` symbol followed by an uppercase letter.
##### Detailed Breakdown
- **Elements**:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,31 @@ class FilterFeedbackInputs(BaseModel):
- Provide hints or suggestions rather than direct corrections.
- Keep the feedback concise and to the point.
- Ensure that the feedback is still relevant and helpful for the student's learning process.
- Really Important: When its incorrect, make sure to **not** provide the correct answer or mention specific detials
- When the feedback indicates that the student correctly implemented something, you should acknowledge their success and mention the specific elements they did well. Do not remove or generalize positive feedback.
Keep the original structure, just change the title and description of the feedback
For example, original feedback:
"title": "Missing Start Event"
"description": "The process is missing the start event"
...
"title": "Method Drive"
"description": "Consider adding a 'drive' method to the 'Car' class. Think about what actions this method should perform."
...
"title": "Class Car"
"description": "Class 'Car' is correctly defined."
Filtered and rewritten feedback:
"title": "Process Initiation"
"description": "Consider how your process begins. Is there a clear starting point? Review the standard elements used to indicate the commencement of a process flow."
...
"title": "Missing Method"
"description": "Read the problem statement carefully and consider what methods are necessary to implement the required functionality. Is the car class missing any methods that are essential for the car to function correctly?"
...
"title": "Class Car"
"description": "Class 'Car' is correctly defined."
Remember, the goal is to guide the student towards improvement without providing a complete solution or grading information in the feedback. Also keep the original structure of the feedback. Just modify the title and description values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class GradedFeedbackInputs(BaseModel):
<UML Diagram Format>
The submission uses the following UML diagram format:
{uml_diagram_format}
- Note: Don't mention elements that have no name, by there articial name: e.g. ##A or ##B, instad just say e.g. the task in ... is missing ...
<Output Format>
{feedback_output_format}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ def convert_to_athana_feedback_model(
manual_structured_grading_instructions: Optional[List[GradingCriterion]] = None
) -> List[Feedback]:

print("Converting feedback to Athena feedback model", feedback_result, manual_structured_grading_instructions, exercise_model.element_id_mapping)

grading_instruction_ids = set(
grading_instruction.id
for criterion in manual_structured_grading_instructions or []
Expand Down

0 comments on commit c70f1db

Please sign in to comment.