docs: update test format documentation in README
Update documentation to reflect new TXT format with separator for summarization tests instead of JSON format. Clarify that expected field may be empty if summary generation fails. feat: change test generation to TXT format with separator Change test generation from JSON to TXT format with TEST_SEPARATOR. Add filename sanitization function to handle MongoDB record IDs. Update output path and file naming logic. Add attempt to generate expected summary through LLM with fallback to empty string.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
Write a Python function that calculates the factorial of a number using recursion.
|
||||
Write a Python function that calculates the factorial of a number.
|
||||
==============
|
||||
def factorial(n):
|
||||
if n == 0 or n == 1:
|
||||
if n == 0:
|
||||
return 1
|
||||
else:
|
||||
return n * factorial(n-1)
|
||||
return n * factorial(n - 1)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Write a Python function that reverses a string.
|
||||
==============
|
||||
def reverse_string(s):
|
||||
return s[::-1]
|
||||
return s[::-1]
|
||||
|
||||
@@ -1,44 +1,9 @@
|
||||
Here's a simple Python programming task:
|
||||
|
||||
**Task:** Write a Python function that checks if a given string is a palindrome or not. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization).
|
||||
|
||||
**Function Signature:**
|
||||
```python
|
||||
def is_palindrome(s: str) -> bool:
|
||||
"""
|
||||
Check if the given string `s` is a palindrome.
|
||||
|
||||
Args:
|
||||
s (str): The input string to check.
|
||||
|
||||
Returns:
|
||||
bool: True if `s` is a palindrome, False otherwise.
|
||||
"""
|
||||
```
|
||||
|
||||
**Example:**
|
||||
|
||||
```python
|
||||
assert is_palindrome("racecar") == True
|
||||
assert is_palindrome("hello") == False
|
||||
assert is_palindrome("A man, a plan, a canal: Panama") == True # Ignoring spaces and punctuation
|
||||
```
|
||||
|
||||
**Hint:** You can use the `str.lower()` method to convert the string to lowercase and the `re` module to remove non-alphanumeric characters.
|
||||
Write a Python function that checks if a number is prime.
|
||||
==============
|
||||
```python
|
||||
import re
|
||||
|
||||
def is_palindrome(s: str) -> bool:
|
||||
"""
|
||||
Check if the given string `s` is a palindrome.
|
||||
|
||||
Args:
|
||||
s (str): The input string to check.
|
||||
|
||||
Returns:
|
||||
bool: True if `s` is a palindrome, False otherwise.
|
||||
"""
|
||||
cleaned = re.sub(r'\W+', '', s.lower())
|
||||
return cleaned == cleaned[::-1]
|
||||
```
|
||||
def is_prime(n):
|
||||
if n <= 1:
|
||||
return False
|
||||
for i in range(2, int(n**0.5) + 1):
|
||||
if n % i == 0:
|
||||
return False
|
||||
return True
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,3 +0,0 @@
|
||||
Summarize the following text in 1-2 sentences: 'The quick brown fox jumps over the lazy dog. The dog, surprised by the fox's agility, barks loudly. The fox continues running without looking back.'
|
||||
==============
|
||||
A quick fox jumps over a lazy dog, surprising it. The fox keeps running while the dog barks.
|
||||
@@ -1,3 +0,0 @@
|
||||
Summarize the following text in 1-2 sentences: 'The quick brown fox jumps over the lazy dog. The dog, surprised by the fox's agility, barks loudly. The fox continues running without looking back.'
|
||||
==============
|
||||
A quick fox jumps over a lazy dog, surprising it. The fox keeps running while the dog barks.
|
||||
@@ -1,3 +0,0 @@
|
||||
Summarize the following text in 1-2 sentences: 'In the realm of programming, machine learning algorithms enable computers to improve their performance on a specific task without being explicitly programmed for each step. These algorithms learn from data, allowing them to identify patterns and make predictions or decisions with increasing accuracy over time. For instance, deep learning models, which are part of artificial intelligence, use neural networks to process vast amounts of information, making significant advancements in areas such as image recognition and natural language processing. As technology advances, these capabilities are being integrated into various sectors, from healthcare to autonomous vehicles, transforming the way we interact with digital systems and enhancing our understanding of complex data sets.'
|
||||
==============
|
||||
Machine learning algorithms allow computers to improve their performance on specific tasks through data-driven pattern recognition, leading to advancements in areas like image recognition and natural language processing, and being increasingly integrated into sectors such as healthcare and autonomous vehicles.
|
||||
@@ -1,2 +0,0 @@
|
||||
Summarize the following text in 1-2 sentences: '<img src="https://res.infoq.com/news/2025/09/linkedin-edge-recommendations/en/headerimage/generatedHeaderImage-1756360053031.jpg"/><p>LinkedIn has detailed its re-architected edge-building system, an evolution designed to support diverse inference workflows for delivering fresher and more personalized recommendations to members worldwide. The new architecture addresses growing demands for real-time scalability, cost efficiency, and flexibility across its global platform.</p> <i>By Leela Kumili</i>'
|
||||
==============
|
||||
@@ -1,3 +1,3 @@
|
||||
Translate the following English text to Russian: 'Hello, how are you today?'
|
||||
Hello, how are you today?
|
||||
==============
|
||||
Привет, как дела сегодня?
|
||||
Привет, как дела сегодня?
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Translate the following Russian text to English: 'Как ваши дела?'
|
||||
The weather is beautiful today. The sun is shining brightly in the clear blue sky.
|
||||
==============
|
||||
How are you?
|
||||
Сегодня прекрасная погода. Солнце ярко светит на чистом голубом небе.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Translate the following English text to Russian: 'What time is it right now?'
|
||||
I would like to order a pizza with mushrooms and olives. Could you please bring it to my table?
|
||||
==============
|
||||
Который сейчас час?
|
||||
Я бы хотел заказать пиццу с грибами и оливами. Не могли бы вы принести ее к моему столу?
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Translate the following English text to Russian: 'What time is it right now?'
|
||||
This project requires attention to detail and good communication skills. Teamwork is essential for success.
|
||||
==============
|
||||
Который сейчас час?
|
||||
Этот проект требует внимания к деталям и хороших навыков общения. Командная работа необходима для успеха.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Translate the following English text to Russian: '"The sun is shining brightly."'
|
||||
Thank you for your help. I really appreciate it.
|
||||
==============
|
||||
Солнце светит ярко.
|
||||
Спасибо за вашу помощь. Я действительно ценю это.
|
||||
|
||||
Reference in New Issue
Block a user