Datasets:
image imagewidth (px) 1.7k 1.7k | id stringlengths 13 16 | text stringlengths 0 4.99k |
|---|---|---|
corpus-test-0 | openstax TM Introduction to Python P | |
corpus-test-1 | ||
corpus-test-2 | Preface 1
Preface About OpenStax
OpenStax is part of Rice University, which is a 501(c)(3) nonprofit charitable corporation. As an educational initiative, it's our mission to improve educational access and learning for everyone. Through our partnerships with philanthropic organizations and our alliance with other educa... | |
corpus-test-3 | Decisions
Figure 4.1 credit: modification of work "Fork The Road", by Ian Sane/Flickr, CC BY 2.0
Chapter Outline
4.1 Boolean values
4.2 If-else statements
4.3 Boolean operations
4.4 Operator precedence
4.5 Chained decisions
4.6 Nested decisions
4.7 Conditional expressions
4.8 Chapter summary
Introduction
The Python int... | |
corpus-test-4 | 92 4 Decisions
bool data type
People often ask binary questions such as yes/no or true/false questions. Ex: Do you like pineapple on pizza? Ex: True or false: I like pineapple on pizza. The response is a Boolean value, meaning the value is either true or false. The bool data type, standing for Boolean, represents a bin... | |
corpus-test-5 | 4.1 Boolean values 93
Suppose the following is added to the code above:
is_dessert = 0
print (itype(ss_ddsertt)
What is the output?
a. <class 'bool'>
b. <class 'int'>
C. Error
Type conversion with bool()
Deciding whether a value is true or false is helpful when writing programs/statements based on decisions. Converting... | |
corpus-test-6 | 94 4 Decisions
a.
True
b.
False
| CONCEPTS IN PRACTICE |
| Converting Booleans to numeric types and strings |
| Given is_on = True, what is the value of each expression? |
| a. 0.0 12. (loat(is_on) |
| b. 1.0 |
| 13. str(is_on) |
| a. "is_on" |
| b. "True" |
| 14. ins(os_on) |
| a. 0 |
| b. 1 |
Comparison operators
Pro... | |
corpus-test-7 | 4.1 Boolean values 95
CONCEPTS IN PRACTICE
Comparing values For each new variable, what is the value of compare_result?
15. X = 14
compare_result = (x <= 13)
a. True
b. False
16. W = 0
compare_result = (w != 0.4)
a. True
b. False
17. v = 4
compare_result = = (v < <4.0)
a. True
b. False
18. y = 2
compare_result = (y > "... | |
corpus-test-8 | 96 4 Decisions
= VS ==
A common mistake is using = for comparison instead of ==. Ex: is zero = num=0 will always assign is_zero and num with 0, regardless of num's original value. The operator performs assignment and will modify the variable. The == operator performs comparison, does not modify the variable, and produc... | |
corpus-test-9 | 4.2 If-else statements 97
numbers. If the result is negative, the program prints an error.
A condition is an expression that evaluates to true or false. An if statement is a decision-making structure that contains a condition and a body of statements. If the condition is true, the body is executed. If the condition is ... | |
corpus-test-10 | 98 4 Decisions
2
if is_raining:
3
print("Don's forget an umbrella!")
4
print("Sea you soon.")
a.
1,2,3
b.
1,2,4
C.
1,2,3,4
4. Given num = -0, what is the final value of num?
if num < 0:
num = 25
if num < 100:
num = num + 50
5. Given input 10, what is the final value of positive_num?
positive_num = int (input ("Enter a ... | |
corpus-test-11 | 4.2 If-else statements 99
# Statements after
CHECKPOINT
Example: Trivia question
Access multimedia content http:///oo....oooooooooooooooooo
else-statements)
CONCEPTS IN PRACTICE
Exploring if-else statements
6. Given the following code, the else branch is taken for which range of x
if X >= 15:
# Do something
else:
# Do ... | |
corpus-test-12 | 100 4 Decisions
TRY IT
Improved division
The following program divides two integers. Division by O produces an error. Modify the program to read in a new denominator (with no prompt) if the denominator is 0.
Access multimedia content http://eeeeeooo//tttoiiioooooeee else-statements)
TRY IT
Converting temperature units
... | |
corpus-test-13 | 2 Preface
Introduction to Python Programming is an interactive offering that teaches basic programming concepts, problem-solving skills, and the Python language using hands-on activities. The resource includes a unique, integrated code runner, through which students can immediately apply what they learn to check their ... | |
corpus-test-14 | | p | q | p and q |
| True | True | True |
| True | False | False |
| False | True | False |
| False | False | False |
| | | Table 4.1 Truth table: p and q. |
4.3 Boolean operations 101
CHECKPOINT
Example: Museum entry
Access multimedia content httpp//eeeea.ooooooooooooooomomo
CONCEPTS IN PRACTICE
Using the and opera... | |
corpus-test-15 | 102 4 Decisions
Logical operator: or
Sometimes a decision only requires one condition to be true. Ex: If a student is in the band or choir, they will perform in the spring concert. The or operator takes two condition operands and returns True if either condition is true
a
| operator takes two condition opera | operator... | |
corpus-test-16 | 4.3 Boolean operations 103
# TTes passed
# TTst failed
a. yes
b. no
Logical operator: not
If the computer is not on, press the power button. The not operator takes one condition operand and returns True when the operand is false and returns False when the operand is true.
is a useful operator that can make a condition ... | |
corpus-test-17 | 104 4 Decisions
if timer > 60:
is turn = not is turn
a. True
b. False
TRY IT
Speed limits
Write a program that reads in a car's speed as an integer and checks if the car's speed is within the freeway limits. A car's speed must be at least 45 mph but no greater than 70 mph on the freeway.
If the speed is within the limi... | |
corpus-test-18 | 4.4
| | Operator | Meaning |
| | not | Logical not operator |
| | and | Logical and operator |
| | or | Logical or operator |
| | | Table 4.4 Operator precedence from highest to lowest. |
| CHECKPOINT | | |
4.4 Operator precedence 105
Operator precedence
Access multimedia content httpt///essssooooooooooooooooto... | |
corpus-test-19 | 106 4 Decisions
comparisons and evaluated from left to right. Ex. 10 <= 20 is evaluated as 10
x and x
<= 20.
CHECKPOINT
Operation precedence
Access multimedia content hhtp:/peeeraoooooooooottoooooooo
| CONCEPTS IN PRACTICE |
| Associativity |
| How is each expression evaluated? |
| 4. 10 + 3 * 2 / 4 |
| a. 10 + (3 * (2... | |
corpus-test-20 | 4.5 Chained decisions 107
b. All operators are evaluated right to left.
C. Order is random when parentheses aren't used.
8. Given x = 8 and y = 9, what is the result of the following?
X + 3 * y 5
a. 30
b. 44
C. 94
9. Given x = 8 and y = 9, what is the result of the following?
(x+3) * (y-5)
a. 30
PEP 8 RECOMMENDATIONS: ... | |
corpus-test-21 | 108 4 Decisions
Two separate if statements do not guarantee that only one branch is taken and might result in both branches being taken. Ex: The program below attempts to add a curve based on the input test score. If the input is 60, both if statements are incorrectly executed, and the resulting score is 75.
score = in... | |
corpus-test-22 | 4.5 Chained decisions 109
C. else
2. Given X = 42 and y = 0, what is the final value of y?
if x > 4
y += 2
elif x < 50:
y += 5
a. 2
b. 5
C. 7
3. Which conditions complete the code such that if x is less than 0, Body 1 executes, else if x equals 0, Body 2 executes.
if
# Body 1
elif
# Body 2
a. x < 0
x == 0
b. x == 0
x <... | |
corpus-test-23 | 110 4 Decisions
elif attendees
<= 4000: :
rooms
+= 14
a.
4
b.
15
C.
18
if-elif-else statements
Elifs can be chained with an else statement to create a more complex decision statement. Ex: A program shows possible chess moves depending on the piece type. If the piece is a pawn, show moving forward one (or two) places. E... | |
corpus-test-24 | Preface 3
The code runner requires the reader to pre-enter any input before running a program.
Many of the programs in this chapter expect input from the user. Enter your name in the Input box below the code. Run the program again, and see what changes. Copy the following lines to the end of the program: print ("What i... | |
corpus-test-25 | 4.5 Chained decisions 111
2
elif condition:
# Body
3
else:
# Body
8. Given x = - andy = 2, what is the final value of y?
if x < 0 and y 0:
y = 10
elif x < 0 and y 0:
y = 20
else:
y = 30
9. How could the following statements be rewritten as a chained statement?
if price < 9.99: order = 50
if 9.99 <= price < 19.99:
order... | |
corpus-test-26 | 112 4 Decisions
elif price < 19.99
order = 30
else:
order = 10
TRY IT
Crochet hook size conversion
Write a program that reads in a crochet hook's US size and computes the metric diameter in millimeters. (A subset of sizes is used.) If the input does not match B-G, the diameter should be assigned with -1.0. Ex: If the i... | |
corpus-test-27 | 4.6 Nested decisions 113
Green
Access multimedia content httpp/p///oooooooooooooooooooooo
Nested decisions
Learning objectives
By the end of this section you should be able to
Describe the execution paths of programs with nested if else statements Implement a program with nested if-else statements.
Nested decision stat... | |
corpus-test-28 | 114 4 Decisions
if players < 3:
print ("Not enough players")
elif players > 6:
print ("Too many players")
else:
print ("Ready to start")
# Test game IDs 3-end
CHECKPOINT
Example: Poisonous plant identification
Access multimedia content http:////pptoooooooooooooooooooo
CONCEPTS IN PRACTICE
Using nested if-else statement... | |
corpus-test-29 | 4.6 Nested decisions 115
# Body 4
else:
# Body 5
a. Body 2
b. Body 2, Body 3
C. Body 2, Body 5
4. Given x =118, y = 300, and max = 512, which of the following will execute?
if x == y:
# Body 1
elif x < y:
# Body 2
if y == max:
# Body 3
else:
# Body 4
else:
# Body 5
a. Body 2
b. Body 3
TRY IT
Meal orders
Write a program... | |
corpus-test-30 | 116 4 Decisions
Access multimedia content http
Conditional expressions
Learning objectives
By the end of this section you should be able to
Identify the components of a conditional expression.
Create a conditional expression.
Conditional expressions
A conditional expression (also known as a "ternary operator") is a sim... | |
corpus-test-31 | 4.7 Conditional expressions 117
c. response =eevn"" if x == 0 else "odd"
2. Given X = 100 and offset = 10, what is the value of result?
result = x + offset if x < <00 else X - offset
3. Which part of the conditional expression is incorrect?
min_num = x if x < y else min_num = y
a. min_num = X
b. x y
C. min_num = y
4. W... | |
corpus-test-32 | 118 4 Decisions
Chapter summary
Highlights from this chapter include:
Booleans represent a value of True or False.
Comparison operators compare values and produce True or False.
Logical operators take condition operand(s) and produce True or False.
Operators are evaluated in order according to precedence and associativ... | |
corpus-test-33 | | | 4.8 Chapter summary |
| Function | Description |
| x and y (Logical) | Evaluates the Boolean values of x and y and returns True if both are true. Ex: True and False is False. |
| x or y (Logical) | Evaluates the Boolean values of x and y and returns True if either is true. Ex: True or False is True. |
| not x (Log... | |
corpus-test-34 | 120
| 4 Decisions | |
| Function | Description |
| | # Statements before |
| | if condition: |
| | elif condition: |
| | # Body |
| | else: # Body |
| elif statement | # Statements after # Body |
| | # Statements before |
| Nested if statement | else: # Body else: if condition: if condition: if condition: # Body... | |
corpus-test-35 | 4 Preface
About the Authors Senior Contributing Authors
Senior contributing authors, left to right: Udayan Das, Aubrey Lawson, Chris Mayfield, and Narges Norouzi.
Udayan Das, Saint Mary's College of California
Udayan Das, PhD, is an Associate Professor and Program Director of Computer Science at Saint Mary's College of... | |
corpus-test-36 | 5 Loons
Loops
Figure 5.1 credit: modification of work "Quantum Computing", by Kevin Dooley/Flickr; CC BY 2.0
Chapter Outline
5.1 While loop
5.2 For loop
5.3 Nested loops
5.4 Break and continue
5.5 Loop else
5.6 Chapter summary
Introduction
A loop is a code block that runs a set of statements while a given condition is ... | |
corpus-test-37 | 122 5 Loops
loop expression is evaluated again.
true, the loop body will execute at least one more time (also called looping or iterating one more time).
false, the loop's execution will terminate and the next statement after the loop body will execute.
CHECKPOINT
While loop
Access multimedia content fftp:///pppt.ooooo... | |
corpus-test-38 | 5.1 While loop 123
Counting with a while loop
A while loop can be used to count up or down. A counter variable can be used in the loop expression to determine the number of iterations executed. Ex: A programmer may want to print all even numbers between 1 and 20. The task can be done by using a counter initialized with... | |
corpus-test-39 | 124 5 . Loops
4. How many times does the loop execute?
a. 3
b. 4
C. 5
5. Which line is printed as the last line of output?
a. value of n after the loop is - -1.
b. value of n after the loop is 0.
C. value of n after the loop is 1.
6. What happens if the code is changed as follows?
n = 4
while n 0: print(n)
# Modified l... | |
corpus-test-40 | 5.2 For loop 125
For loop
Learning objectives
By the end of this section you should be able to
Explain the for loop construct.
Use a for loop to implement repeating tasks.
For loop
In Python, a container can be a range of numbers, a string of characters, or a list of values. To access objects within a container, an ite... | |
corpus-test-41 | 126 5 Loops
str_var = = "A string"
count = 0
for c in str_var:
count += 1
#New line
print(c, end = '*')
print (count)
a. A string*
b. ************g*
C. A* ***t*
C.
| Range() function in for loop | Range() function in for loop | | |
| | A for loop can be used for iteration and counting. The range() function is a comm... | |
corpus-test-42 | | | | | 5.2 For loop |
| Range function | Description | Example | Output |
| | | range (3, -2, -1) | 3, 2, 1, 0, -1 |
| | | range (10, 0, -4) | 10, 6, 2 |
| | Table 5.1 Using the range() function. | | |
| EXAMPLE 5.2 | | | |
5.2 For loop 127
Two
| programs printing all integer multiples of 5 less construct... | |
corpus-test-43 | 128 5 Loops
6. What is the sequence generated from range (-1, -2, -1)?
a. 1
b. -,, -2
C. 2
7. What is the output of the range (1, 2, -1)?
a. 1
b. 1, 2
C. empty sequence
8. What is the output of range (5, 2)?
a. 0, 2, 4
b. 2, 3, 4
C. empty sequence
TRY IT
Counting spaces
Write a program using a for loop that takes in a ... | |
corpus-test-44 | 5.3 Nested loops 129
Nested loops
Learning objectives
By the end of this section you should be able to
Implement nested while loops.
Implement nested for loops.
Nested loops
A nested loop has one or more loops within the body of another loop. The two loops are referred to as outer loop and inner loop. The outer loop co... | |
corpus-test-45 | 130 5 . Loops
CONCEPTS IN PRACTICE
Nested while loop question set
1. Given the following code, how many times does the print statement execute?
i = 1
while i <= 5:
j = 1
while i + j <= 5:
print(i, j)
j += 1
i += 1
2. What is the output of the following code?
3. Which program prints the following output?
1
2
3
4
2
4
6
8... | |
corpus-test-46 | Preface 5
Yamuna Rajasekhar, PhD, is Director of Content, Authoring, and Research at Wiley. She works across disciplines on research strategy, authoring pedagogy and training, and content development for Computer Science and IT. She received her MS and PhD from University of North Carolina at Charlotte, focusing on Com... | |
corpus-test-47 | 5.3 Nested loops 131
i += 1
b. i = 1
while i <= 4:
j = 1
while j <= 4:
print (i * j, end = )
j += 1
print()
i += 1
c. i = 1
while i <= 4:
j = ==1
while j <= 4:
print (i * j, end = )
j += 1
i += 1
Nested for loops
A nested for loop can be implemented and used in the same way as a nested while loop. A for loop is a prefe... | |
corpus-test-48 | 132 5 Loops
for j in range (4)
print (i, '', j)
a.
4
b.
12
C.
20
6. Which program prints the following output?
0 1 2 3
0 2 4 6
0 3 6 9
a. for i in range (4) :
for j in range (4) :
print(1 * j, end ) print()
b. for i in range(1, 4)
for j in range (4)
print(1 * j)
C. for i in range(1, 4)
for j in range (4): :
print (i * ... | |
corpus-test-49 | 5.4 Break and continue 133
TRY IT
Printing a triangle of numbers
Write a program that prints the following output:
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
1
2
3
4
5
6
1
2
3
4
5
1
2
3
4
1 2
3
1 2
1
Finish!
Access multimedia content http://ottopppppisrrrrrroprrr/oe
5-3-nested-loops)
TRY IT
Printing two triangles
... | |
corpus-test-50 | 134 5 Loops
Break
A break statement is used within a for or a while loop to allow the program execution to exit the loop once a given condition is triggered. A break statement can be used to improve runtime efficiency when further loop execution is not required.
Ex: A loop that looks for the character "a" in a given st... | |
corpus-test-51 | 5.4 Break and continue 135
string_val = "Hello World"
for c in string_val:
if c == "::
break
print (c)
a.
Hello
b. Hello World
0
2. Given the following code, how many times does the print statement get executed?
i = 1
while True:
if i83 == 0 and i%5 == 0:
print(i)
break
i + 1
a. 0
b. 1
C. 15
3. What is the final value ... | |
corpus-test-52 | 136 5 Loops
CHECKPOINT
Continue statement in a while loop
Access multimedia content http://pppskoooooooooooooooggooo
CONCEPTS IN PRACTICE
CONCEP IS In pRaCTICE
Using a continue statement
4. Given the following code, how many times does the print statement get executed?
i = 10
while i >= 0:
i == 1
if i%3 == 0:
continue
... | |
corpus-test-53 | 5.5 Loop else 137
TRY IT
Using break control statement in a loop
Write a program that reads a string value and prints "Found" if string contains a space character. Else, prints "Not found".
Access multimedia content fttt:///ooo...oooooooooooooooooo 5-4-brekk-ad-ccontiuue)
Using a continue statement in a loop
Complete t... | |
corpus-test-54 | 138 5 Loops
the code prints "10 is not in the list.".
numbers = [2, 5, 7, 11, 12]
seen = False
for i in numbers:
if i == 10:
print ("Found 10!")
seen = True
if seen == False:
print ("10 is not in the list.
numbers = [2, 5, 7, 11, 12]
for i in numbers: :
if i == 10:
print ("Found 10!")
break
else:
print ("10 is not in t... | |
corpus-test-55 | 5.5 Loop else 139
print (n, "is 2 to the", exp
lumbers = [1, 2, 2, 6]
or i in numbers:
if i >= 5:
print ("Not all numbers are less than 5.")
break
print ("all numbers are less than 5.
a.
1
2
2
6
Not all numbers are less than 5.
b.
1
2
2
Not all numbers are less than 5.
c.
1
2
2
6
all numbers are less than 5. | |
corpus-test-56 | 140 5 . Loops
TRY IT
sum of values less than 10
Write a program that, given a list, calculates the sum of all integer values less than 10. If a value greater than or equal to 10 is in the list, no output should be printed. Test the code for different values in the list.
Access multimedia content hitpg//oeea..../o////oo... | |
corpus-test-57 | 6 Preface Approved Ask Instructor Not Approved Your Original Work Quoting & Crediting Another's Work Checking Your Answers Online Group Work Reusing Past Original Work Sharing Answers Artificial Intelligence, Chatbot Apps Posting Questions & Answers Plagiarizing Work Work Getting Others To Do Your Work
attribution: Cop... | |
corpus-test-58 | 5.6 Chapter summary
| Function | Description |
| whileloop | # initialization while expression: # statements after the loop # loop body |
| for loop | initialization for Loop_variable in container: # loop body the # statements after loop |
| Nested while loop | while outer_loop_expressio::: outer loop body (1) # # stat... | |
corpus-test-59 | 5 Loops
| Function | Description |
| continue statement | # loop body if continue_condition: # remaining body of loop # statements after the loop continue while loop_expression: # initialization |
| Loop else statement | # loop else statement # initialization for loop_expression: # loop body if break_condition: break #... | |
corpus-test-60 | 5.6 Chapter summary 143
Access multimedia content hotpeppp/ooooooooooooooooooooooo | |
corpus-test-61 | 144 5 Loops
Access for free at openstax.org | |
corpus-test-62 | X WEST OMSTT TURTLES TURTLE LS 1N TIME 6 Functions Figure 6.1 credit: modification of work "IMG_3037", by Jay Roc/Flickr, Public Domain Chapter Outline
6.1 Defining functions
6.2 Control flow
6.3 Variable scope
6.4 Parameters
6.5 Return values
6.6 Keyword arguments
6.7 Chapter summary
Introduction
Functions are the nex... | |
corpus-test-63 | 146 6 Functions
Calling a function
Throughout the book, functions have been called to perform tasks. Ex: print () prints values, and sqrt() calculates the square root. A function is a named, reusable block of code that performs a task when called.
CHECKPOINT
Example:
Simple math program
Access multimedia content http:/... | |
corpus-test-64 | 6.1 Defining functions 147
Defining a function
A function is defined using the def keyword. The first line contains def followed by the function name (in snake case), parentheses (with any parameters-discussedd later), and a colon. The indented body begins with a documentation string describing the function's task and ... | |
corpus-test-65 | 148 6 Functions
Benefits of functions
A function promotes modularity by putting code statements related to a single task in a separate group. The body of a function can be executed repeatedly with multiple function calls, so a function promotes reusability. Modular, reusable code is easier to modify and is shareable am... | |
corpus-test-66 | 6.2 Control flow 149
Access multimedia content http:/p///oooooooooooooooooooooa
TRY IT
Terms and conditions prompt
Write a function, terms (), that asks the user to accept the terms and conditions, reads in Y/N, and outputs a response. In the main program, read in the number of users and call terms () for each user.
Gi... | |
corpus-test-67 | 150 6 Functions
CHECKPOINT
Calling a brunch menu function
Access multimedia content http:///ppoooooooooooooooooomooo
6-2-control-flow)
CONCEPTS IN PRACTICE
Following the control flow
1. Which line is executed first?
def park_greet() :
"""Output greeting.""
print ("Welcome. Open sunrise to sunset.")
car_count = 1
park_g... | |
corpus-test-68 | def where_ is(point): ary litt natch point: case Point(xx00 y-0): eccinng Lists print("Origin") case Point(x-0, yey): case Point(xxx, y=0): ns case Point(): print( ("Somewhere else") ms I V { F2 U S A @ 1 Statements
Figure 1.1 credit: Larissa Chu, CC BY 4.0
Chapter Outline
1.1 Background
1.2 Input/output
1.3 Variables
... | |
corpus-test-69 | 6.2 Control flow 151
print ("Take the second right to park.")
def park_greet():
"""Output greeting.""
print ("Welcome. Open sunrise to sunset.")
car_count = 1 park_greet() if car_count > 50: extra_lot()
a.
5
b.
8
C.
12
4. What is the output?
def park_greet ()
"""Output greeting."
print ("Welcome to the park")
print ("O... | |
corpus-test-70 | 152 6 Functions
5. How many function calls occur during the execution of the program?
6. When line 3 is reached and executed, which line does control flow return to?
a. 1
b. 11
C. 16
TRY IT
Updated terms and conditions prompt
Write an updated function, terms (), that asks the user to accept the terms and conditions, re... | |
corpus-test-71 | 6.3 Variable scope 153
Given inputs 50 and 40, the output is
Liam's Laundry
7a - 11p
Open washers: 50
Open dryers: 40
Access multimedia content http:/pooooooooooooooocoooooomeo
Variable scope
Learning objectives
By the end of this section you should be able to
Identify the scope of a program's variables.
Discuss the im... | |
corpus-test-72 | 154 6 Functions
num_sq = num num
print (num, "squared is", num_sq)
num = float (input ()) )
print_square
a. num only
b. num_sq only
c. num and num_sq
3. Which functions can access num?
def print_double() num_d = num * 2
print (num, "doubled is", num_d)
def print_square(1 num_sq = num num
print (num, "squared is", num_s... | |
corpus-test-73 | 6.3 Variable scope 155
def print_time(()
out_str "Time is + str(hour) ":" + str(min)
print(out_str)
hour = (nt(in
min = int (input
a. hour and min
b. out_str
c. hour, min, and out_str
5. Which variables are local?
def print_greeting (): : prunt(out_ssr)
hour = int(inpu(())
min int (itpun ())
if hour < 12:
out_str "Good... | |
corpus-test-74 | 156 6 Functions
Using local and global variables together
Python allows global and local variables to have the same name, which can lead to unexpected program
behavior. A function treats a variable edited within the function as a local variable unless told otherwise. To edit a global variable inside a function, the var... | |
corpus-test-75 | 6.3 Variable scope 157
a. New hour: 9
b. New hour: 10
C. Error
9. What is the output?
Enter hour: ) update_hour()
print ("New hour:", new_hour)
def update_hour()
global new_hour
new_hour = hour
if is_dst:
new_hour += 1
else:
new_hour = 1
is_dst = True
hour = int (input ("Enter hour: ") ) update_hour()
print ("New hour:... | |
corpus-test-76 | 158 6 Functions
practice ():
Reads in a string representing the desired map.
Prints "Launching practice on [desired map]".
Note: find_teammates () is provided and does not need to be edited.
Given input:
The output is:
Finding
2 players.
Match starting
Given input
The output is:
Launching practice on Queen's Canyon
Acc... | |
corpus-test-77 | 6.4 Parameters 159
CHECKPOINT
Global and local variables in a program with a function
Access multimedia content http://ooo....oooooocooooooomemo
6-4-parameters)
CONCEPTS IN PRACTICE
Arguments and parameters
Consider the following:
1
def print_welcome (name)
2
print (f"Welcome {name}!")
3
4
username = int (input ( ("Ent... | |
corpus-test-78 | 160 6 Functions
def print_div(op_1) op_2):
""" Prints division operation """
print (fp_opp_}\/op__} = {op_1/op_2}")
num 1 = 6
num_2 = 3
print_div (num_,, num 2)
# Prints "6/3 = 2.0"
print_div (num_ 2, num_1)
# Prints "3/6 = 0.5"
print_div (num_ 1) # Error: Missing argument: op 2
CONCEPTS IN PRACTICE
Multiple arguments ... | |
corpus-test-79 | 8 1 Statements
Background
Learning Objectives
By the end of this section you should be able to
Name two examples of computer programs in everyday life.
Explain why Python is a good programming language to learn.
Computer programs
A computer is an electronic device that stores and processes information. Examples of comp... | |
corpus-test-80 | 6.4 Parameters 161
uses a pass-by-object-referenne system. If an argument is changed in a function, the changes are kept or lost depending on the object's mutability. A mutable object can be modified after creation. A function's changes to the object then appear outside the function. An immutable object cannot be modif... | |
corpus-test-81 | 162 6 Functions
CONCEPTS IN PRACTICE
Mutability and function arguments
8. In convert_temps (), wknd_temps and temps refer to in memory.
a. the same object
b. different objects
9. After unit is assigned with "C", metric and unit refer to in memory
a. the same object
b. different objects
10. deg_sign is a string whose va... | |
corpus-test-82 | 6.5 Return values 163
points to add. For each score, print the original score and the sum of the score and bonus. Make sure not to
hange the list.
siven function call:
print_scores (667, 68, 72, 71, 69], 10)
The output is:
67 would be updated to 77
68 would be updated to 78
72 would be updated to 82
71 would be updated... | |
corpus-test-83 | 164 6 Functions
mpg
miles/gallons
return
mpg
a.
mpg
b.
None
C.
Error
2. What is returned by calc_sqft ()?
def calc_sqft (length, width)
sqft = llegtt * width
3. What is the difference between hw_1() and hw_2()?
def hw_1()
print ("Hello world!")
return
def hw_2()
print ("Hello world!")
a. hw_1() returns a string, hw_2()... | |
corpus-test-84 | | indicate problem. | | |
| a CONCEPTS IN | def calc_mpg (miles, gallons): if gallons 0: miles/gallons mpg = return mpg else: print ("Gallons can't be 0") return -1 | Car 1's mpg is 28.0 Gallons can't be 0 Car 2's mpg is -1 |
| | car_1_mpg = calc_mpg(448, 16) print ("Car 1's is", 1_mpg mpg car 2_mpg calc_mpg (300, 0... | |
corpus-test-85 | 166 6 Functions
if level < max
return level
level += 1
else
return level
voll = inc_volume (9, 10)
print (voll)
vol2 = inc_volume (10, 10)
print (vol2)
Using functions as values
uunctions are objects that evaluate to values, so function calls can be used in expressions. A function call can combined with other function ... | |
corpus-test-86 | 6.5 Return values 167
b. 126.0
b.
What is the value of val2?
def sq(num) return num * num
def offset (num) :
return num 2
val = 5
val2 = dr(offse((vll)
a. 9
TRY IT
Estimated days alive
Write a function, days_alive() that takes in an age in years and outputs the estimated days the user has been alive as an integer. Assu... | |
corpus-test-87 | 168 6 Functions
6.6 Keyword arguments Learning objectives
By the end of this section you should be able to
Describe the difference between positional and keyword arguments.
Create functions that use positional and keyword arguments and default parameter values.
Keyword arguments
So far, functions have been called using... | |
corpus-test-88 | 6.6 Keyword arguments 169
C.
4. Which function call would produce an error?
a. greeting ("Morning", "Morgan", count=3)
b. greeting (count=1, "Hi", "Bea")
greeting ("Cheers", "Colleagues", 10)
Default parameter values
Functions can define default parameter values to use if a positional or keyword argument is not provide... | |
corpus-test-89 | 170 6 Functions
a. Hello Friend
b. nothing
C. Error
PEP 8 RECOMMENDATIONS: SPACING
The PEP 8 style guide recommends no spaces around = when indicating keyword arguments and default
parameter values.
TRY IT
Stream donations
Write a function, donate (), that lets an online viewer send a donation to a streamer. donate () ... | |
corpus-test-90 | 1.1 Background 9
EXPLORING FURTHER
Later chapters of this book show how to write analysis programs using real data. Example libraries that
provide access to online streaming services include /ttp://p/pppepttttrrrrrrr////ppp Pytube
https://openttaa..rrrrrrrr//ppep and Pydora (ttpp://ppepnst...rr//////yyyrr. Python-relat... | |
corpus-test-91 | 6.7 Chapter summary 171
input by the calling code. Parameters are assigned with the arguments' values.
Function calls can use positional arguments to map values to parameters in order.
Function calls can use keyword arguments to map values using parameter names in any order.
Functions can define default parameter value... | |
corpus-test-92 | 172
| 6 Functions | |
| Construct | Description |
| Keyword arguments | def function_name (parameter_1 parameter _2) # Function body function_name (parameter _ = 5, parameter _1 2) = |
| Default parameter value | def function_name (parameter_1 100): = Function body # |
| Table 6.2 Chapter 6 reference. | |
Access for ... | |
corpus-test-93 | Modules
Figure 7.1 credit: modification of work "Lone Pine Sunset", by Romain Guy/Flickr, Public Domain
Chapter Outline
7.1 Module basics
7.2 Importing names
7.3 Top-level code
7.4 The help function
7.5 Finding modules
7.6 Chapter summary
Introduction
As programs get longer and more complex, organizing the code into mo... | |
corpus-test-94 | 174 7 Modules
Technically, every program in this book is a module. But not every module is designed to run like a program. Running greetings.py as a program would accomplish very little. Two functions would be defined, but the functions would never be called. These functions are intended to be called in other modules.
... | |
corpus-test-95 | 7.1 Module basics 175
"""Gets the area of an ellipse. """
return math. pi *major *minor
# 3D shapes
# 3D shapes
def sube(side)
"""Gets the surface area of a cube."""
return 6 * side**2
def cylinder(radius, height):
"""Gets the surface area of a cylinder.""
return 2 * math.pi * radius * (radius + height)
def cone(radius... | |
corpus-test-96 | 176 7 Modules
import area
print ("Area of a basketball court:", area. rectangle (94, 50))
print ("Area of a circus ring:", area. circle (21)
The output is:
Area of a basketball court: 4700
Area of a circus ring:
1385.4423602330997
CHECKPOINT
Importing area in a Python shell
Access multimedia content fttp:////oot.oooooo... | |
corpus-test-97 | 7.2 Importing names 177
The formula is 9/5
C + 32.
2. fah2cel (f)
Converts a temperature in Fahrenheit to Celsius.
The formula is 5/9
(f 32).
3. km2mi (km)
Converts a distance in kilometers to miles.
The formula is km / 1.60934.
4. mi2km ( (mi) )
Converts a distance in miles to kilometers.
The formula is mi 1.60934.
Ea... | |
corpus-test-98 | 178 7 Modules
The from keyword
Specific functions in a module can be imported using the from keyword:
from area import triangle, cylinder
These functions can be called directly, without referring to the module:
print (triangle(1 2))
print (cylinder (3, 4))
EXPLORING FURTHER
As shown below, the from keyword can lead to ... | |
corpus-test-99 | 7.2 Importing names 179
used
rom area import cube
def cube (x) # Name collision (replaces the imported function)
return x ** 3
print (cube (2)) # Calls the local cube() function, not area. cube ()
A programmer might not realize the cube function is defined twice because no error occurs when running the program. Name co... |
RCP-nDCG · ViDoRe v3 (MTEB-style, with continuous relevance gains)
Evaluate with stock mteb (≥ 2.10.5). No fork is
needed. This repo ships rcp_ndcg_tasks.py. It defines one mteb task per subset (8 tasks, e.g. Vidore3ComputerScienceRCPReranking),
which reports the continuous-gain metric ndcg_float_at_10 alongside mteb's usual metrics:
import importlib.util
import mteb
from huggingface_hub import hf_hub_download
path = hf_hub_download("fabianschmidt-cohere/rcp-ndcg-vidore-v3", "rcp_ndcg_tasks.py", repo_type="dataset")
spec = importlib.util.spec_from_file_location("rcp_ndcg_tasks", path)
rcp = importlib.util.module_from_spec(spec)
spec.loader.exec_module(rcp)
tasks = rcp.get_tasks() # all subsets; or rcp.get_tasks(["hr", "energy"])
model = mteb.get_model("sentence-transformers/all-MiniLM-L6-v2") # any mteb bi- or cross-encoder
results = mteb.evaluate(model, tasks=tasks)
Each view is its own task, so the task name in a results file says which one produced the score:
rcp.get_tasks(): reranking over the judged pool (Vidore3ComputerScienceRCPReranking), the recommended setting.rcp.get_tasks(view="retrieval"): open-corpus retrieval (Vidore3ComputerScienceRCPRetrieval), bi-encoders only; see Recommended use below.rcp.get_tasks(text_only=True): the OCR'ed-markdown text view (…RCPRerankingOCR), for text-only models; combine withview="retrieval"for its open-corpus variant.
The same reranking tasks are in mteb itself once
PR #5516 is merged.
When your mteb ships a task of the same name, it pins this release's commit by its sha.
get_tasks(revision="<that sha>") returns the built-in task, and get_tasks() loads the same commit by
its tag, so the numbers are identical either way.
Renamed (October 2026). Earlier versions of
rcp_ndcg_tasks.pynamed the reranking tasks…RCPRetrieval. They are now…RCPReranking, like mteb's other reranking tasks, and…RCPRetrievalnames the open-corpus view. Results computed with the earlier file under…RCPRetrievalnames are reranking results; rename them to…RCPReranking. The earlier file also indexed only the pooled documents. That leaves dense-model scores unchanged but not those of models that use corpus statistics (e.g. BM25), so re-run those.
The 8 public ViDoRe v3 domains × 6 query languages form 48 subsets. Each subset gets the judged 150-page candidate pool and calibrated relevance probabilities from an LLM judge. The full provenance of how the pools and gains were made is included.
RCP-nDCG (nDCG over rubric-calibrated preferences) replaces binary relevance labels with
calibrated relevance probabilities. An LLM judge compares pooled documents in a listwise tournament and
checks each one against a rubric of five binary relevance criteria. A 2PL item-response model then
calibrates those verdicts into a latent relevance theta per (query, document), and the relevance
probability gain(theta) is the gain in nDCG.
⚠️ Gains come from ONE judge: Qwen3.5-397B-A17B (NVFP4)
Every gain value comes from a single LLM judge, Qwen3.5-397B-A17B (NVFP4 quantisation). The
judge rated each pooled page against a 5-criterion ladder. A 2PL IRT model was fitted to those
ratings and calibrated. The gain is the paper's weighted_discrimination link:
gain(θ) = Σ_k γ_k · σ(γ_k (θ − β_k)) / Σ_k γ_k
It maps into (0, 1) and uses the fitted item_params (provenance/item_params.qwen35.json). The raw
calibrated theta ships next to gain, so any other link can be recomputed without re-judging.
ViDoRe v3 was judged by one judge (Qwen3.5-397B).
Releases and judge provenance
| release | Hub tag | revision (pinned by mteb) | judge | calibration | status |
|---|---|---|---|---|---|
| 1 | v1-nvidia-qwen3.5-397b-a17b-nvfp4 |
b22323345cb5639944600d490969bcce9fba7943 |
nvidia/Qwen3.5-397B-A17B-NVFP4 | 2PL IRT, provenance/item_params.qwen35.json |
superseded |
| 2 | v2-nvidia-qwen3.5-397b-a17b-nvfp4 |
this revision | nvidia/Qwen3.5-397B-A17B-NVFP4 | 2PL IRT, provenance/item_params.qwen35.json |
current |
- The data (corpus, queries, qrels with
gain/theta, pools and provenance) was last changed in this revision, the commit taggedv2-nvidia-qwen3.5-397b-a17b-nvfp4. The same commit holds this card,provenance/releases.jsonand thercp_ndcg_tasks.pyof release 2. mteb and the reference results pin this commit by its sha; the tag names the same commit, so both load identical data. The v1 tagv1-nvidia-qwen3.5-397b-a17b-nvfp4remains loadable and keeps the v1 gains (data commitadb6a2a8). - A new judge or a recalibration is a new release: a new commit with the new gains, a new tag
v<N>-<judge>, and new mteb task versions (<task>.v<N>) whose predecessors are markedsuperseded_by. Release 2 is a recalibration of the same judge's answers (see Relation to the paper); it keeps the task names, since the mteb tasks are not merged yet. History is never rewritten or squashed, so every pinned revision stays loadable.rcp.get_tasks()loads release 2 by its tag. To evaluate a specific release, pass its tag or the commit sha that mteb pins:rcp.get_tasks(revision="v1-nvidia-qwen3.5-397b-a17b-nvfp4"). - The same information, machine-readable:
provenance/releases.json.
Recommended use: reranking
Each subset ships top_ranked, the judged 150-page pool the paper's rerankers scored. Loaded through
mteb, a model reranks exactly this pool. This is the recommended setting, because every candidate
has a gain:
ndcg_at_10: standard nDCG over the upstream graded qrels (0/1/2).ndcg_float_at_10(the main score): nDCG over the calibrated relevance probabilities, with linear gain. Documents tied on score are credited their tie group's mean gain.
Open-corpus retrieval works from the same data (view="retrieval", tasks …RCPRetrieval): the
full upstream corpus is searched. The same metrics are reported, and the main score is
still ndcg_float_at_10, but it becomes a pooled-judgment score: gains exist only for the judged
pool, so a retrieved document outside it counts as gain 0. Compare open-corpus scores only with
each other, not with the reranking scores.
Layout
Subset names are {domain}__{language}, e.g. energy__french.
- domains: computer_science, energy, finance_en, finance_fr, hr, industrial, pharmaceuticals, physics
- languages: english, french, german, italian, portuguese, spanish
| config | columns | notes |
|---|---|---|
{subset}-corpus |
image, id, text |
upstream page images + OCR markdown, byte-identical copy; one copy per domain, shared by its 6 languages |
{subset}-queries |
id, text |
the queries in that language |
{subset}-qrels |
query-id, corpus-id, score, gain, theta |
score: upstream graded qrels (1, 2), unchanged; gain: calibrated relevance probability (see below) |
{subset}-top_ranked |
query-id, corpus-ids |
the judged 150-page pool |
provenance-pool |
query-id, corpus-id, pool_rank, rrf_score, gt_injected |
split = domain |
provenance-first-stage |
retriever, query-id, corpus-id, rank, score |
embed_v4, bm25, octen, rrf_fused |
provenance-runs |
model, query-id, corpus-id, score, rank_by_score, stored_position |
14 rerankers |
provenance-judge-criteria |
query-id, call_index, corpus-id, C1…C5, finish_reason |
14.5M per-call binary criterion verdicts, the 2PL fit's raw observations |
Gains live in the qrels. {subset}-qrels has one row per (query, document) in the judged pool.
Every human-labelled page is in the pool (ground-truth injection, below):
score: the human relevance label, unchanged (0 for pooled pages without a label).gain: the calibrated relevance probability, used byndcg_float_at_k.theta: the raw calibrated latent relevance behindgain.
Stock mteb reads only query-id, corpus-id, score. The extra score-0 rows change none of its
retrieval scores (verified on every published run). Two caveats:
- A
scoreof 0 does not mean a human judged the document non-relevant. For the original human qrels, filterscore > 0; for the judged pool, filterthetanot null. - Statistics that count "annotated" documents treat the judged pool as annotated. This affects mteb's
descriptive statistic
unique_relevant_docs, and trec_eval'sbpref/ judged@k.
Ids use the upstream form (query-test-<n>, corpus-test-<n>). They join exactly with
mteb/Vidore3<Domain>OCRRetrieval at the revision pinned in the mteb task file, and with
vidore/vidore_v3_<domain>_mteb_format.
How the pool was built (fully reproducible)
- First stage, top-150 each from three retrievers over the page OCR text:
- Cohere Embed v4
- BM25
- Octen-Embedding-8B
- Reciprocal Rank Fusion: unweighted,
k = 60, fused in the order embed_v4, bm25, octen, top 150. Fusingprovenance-first-stagereproducesrrf_fusedexactly: scores to <1e-12 and the same id order. - Ground-truth injection: any qrel-positive page missed by the fused top-150 replaces the
lowest-ranked non-relevant page. It is marked
gt_injected = truewithrrf_score = 0. That is 11,843 of 2,177,100 pool pairs. Without it, the gains could not cover every relevant page. - Judging + calibration: the judge rated every pool page against the 5 criteria (C1–C5). A 2PL model was fitted, and θ was calibrated per query.
Results: 14 rerankers under both tie rules
nDCG@10 in %, each reranker scoring the judged 150-page pool (top_ranked). RCP-nDCG@10 uses the
gain column with linear gain; its ideal ranking takes all gains of the query. qrel-nDCG@10 uses the
integer score with linear gain; its ideal ranking takes all positive qrels. The two tie rules differ
only in how pages with identical reranker scores are ordered:
- (a) breaks ties by document id (score descending, then corpus-id descending), the trec_eval / pytrec_eval convention.
- (b) credits each tied page its tie group's mean gain, the expected nDCG over all orderings of the
tie. This is the paper's rule (arXiv v2: every suite, both metrics), and mteb's
ndcg_float_at_kuses it.
Two views follow. The paper scores each question once, in its native language (french for energy,
finance_fr and physics; english for the other five domains). The mteb tasks, like mteb's other ViDoRe
v3 tasks, average one score per language subset (6 per domain); five of the six subsets pose translated
questions over the same pages. Mean is the unweighted mean over the 8 domains. All numbers are
replayed from provenance-runs at this revision.
Native-language questions (the paper's unit; 2,419 questions)
RCP-nDCG@10 (%), rule (a): document-id tie-break
| Reranker | Comp. Sci. | Energy | Finance (en) | Finance (fr) | HR | Industrial | Pharma. | Physics | Mean |
|---|---|---|---|---|---|---|---|---|---|
| CTXL-RR-1B | 85.2 | 88.1 | 82.5 | 82.2 | 85.3 | 81.5 | 83.7 | 86.8 | 84.4 |
| CTXL-RR-2B | 82.9 | 89.8 | 85.7 | 83.7 | 87.9 | 85.0 | 85.6 | 88.1 | 86.1 |
| CTXL-RR-6B | 79.0 | 89.0 | 86.5 | 85.5 | 88.0 | 85.1 | 84.7 | 88.1 | 85.7 |
| Jina-RR-v3 | 73.3 | 70.5 | 67.8 | 64.2 | 69.7 | 74.3 | 76.0 | 77.0 | 71.6 |
| Qwen3-RR-0.6B | 82.4 | 79.6 | 74.6 | 66.6 | 73.1 | 76.3 | 77.8 | 83.4 | 76.7 |
| Qwen3-RR-4B | 87.7 | 86.6 | 79.5 | 80.4 | 82.7 | 81.1 | 83.9 | 88.2 | 83.8 |
| Qwen3-RR-8B | 88.4 | 89.3 | 82.6 | 85.1 | 85.3 | 84.1 | 85.9 | 89.4 | 86.3 |
| RR4-Fast | 89.9 | 90.1 | 87.2 | 84.7 | 88.4 | 85.1 | 86.7 | 88.3 | 87.6 |
| RR4-Pro | 90.9 | 93.0 | 88.5 | 90.3 | 90.4 | 87.9 | 89.1 | 91.8 | 90.2 |
| Voyage2.5-lt | 91.7 | 90.6 | 86.8 | 85.2 | 89.8 | 87.7 | 88.7 | 87.0 | 88.4 |
| Voyage2.5 | 93.3 | 93.3 | 86.5 | 87.4 | 91.7 | 89.1 | 90.3 | 91.1 | 90.4 |
| zerank-1-sm | 93.3 | 91.0 | 88.2 | 86.7 | 90.1 | 87.8 | 88.1 | 90.9 | 89.5 |
| zerank-1 | 94.2 | 93.3 | 88.8 | 89.6 | 91.6 | 89.1 | 90.9 | 93.4 | 91.4 |
| zerank-2 | 94.3 | 93.6 | 87.6 | 89.6 | 91.9 | 89.4 | 91.2 | 93.8 | 91.4 |
RCP-nDCG@10 (%), rule (b): group-mean gain for ties
| Reranker | Comp. Sci. | Energy | Finance (en) | Finance (fr) | HR | Industrial | Pharma. | Physics | Mean |
|---|---|---|---|---|---|---|---|---|---|
| CTXL-RR-1B | 85.1 | 88.0 | 82.5 | 82.2 | 85.3 | 81.5 | 83.7 | 86.8 | 84.4 |
| CTXL-RR-2B | 82.9 | 89.9 | 85.7 | 83.7 | 87.9 | 85.0 | 85.6 | 88.1 | 86.1 |
| CTXL-RR-6B | 79.0 | 89.0 | 86.5 | 85.5 | 88.0 | 85.1 | 84.7 | 88.1 | 85.7 |
| Jina-RR-v3 | 73.3 | 70.5 | 67.8 | 64.2 | 69.7 | 74.3 | 76.0 | 77.0 | 71.6 |
| Qwen3-RR-0.6B | 82.5 | 79.7 | 75.0 | 67.2 | 72.5 | 76.4 | 78.3 | 83.3 | 76.9 |
| Qwen3-RR-4B | 87.7 | 86.5 | 79.5 | 80.4 | 82.7 | 81.0 | 84.1 | 88.2 | 83.7 |
| Qwen3-RR-8B | 88.4 | 89.2 | 82.6 | 85.1 | 85.3 | 84.1 | 86.0 | 89.3 | 86.2 |
| RR4-Fast | 89.9 | 90.1 | 87.2 | 84.7 | 88.4 | 85.1 | 86.8 | 88.3 | 87.6 |
| RR4-Pro | 90.8 | 93.0 | 88.6 | 90.2 | 90.4 | 87.9 | 89.1 | 91.7 | 90.2 |
| Voyage2.5-lt | 91.6 | 90.7 | 86.8 | 85.2 | 89.8 | 87.7 | 88.6 | 87.0 | 88.4 |
| Voyage2.5 | 93.3 | 93.3 | 86.5 | 87.5 | 91.8 | 89.1 | 90.3 | 91.1 | 90.4 |
| zerank-1-sm | 93.2 | 90.9 | 88.2 | 86.7 | 90.1 | 87.8 | 88.1 | 90.9 | 89.5 |
| zerank-1 | 94.2 | 93.3 | 88.8 | 89.6 | 91.6 | 89.1 | 90.9 | 93.4 | 91.4 |
| zerank-2 | 94.3 | 93.6 | 87.6 | 89.6 | 91.9 | 89.4 | 91.2 | 93.8 | 91.4 |
qrel-nDCG@10 (%), rule (a): document-id tie-break
| Reranker | Comp. Sci. | Energy | Finance (en) | Finance (fr) | HR | Industrial | Pharma. | Physics | Mean |
|---|---|---|---|---|---|---|---|---|---|
| CTXL-RR-1B | 77.7 | 68.9 | 69.0 | 49.7 | 65.5 | 57.4 | 66.4 | 49.1 | 63.0 |
| CTXL-RR-2B | 76.8 | 71.6 | 71.7 | 53.2 | 68.1 | 61.1 | 67.4 | 49.0 | 64.9 |
| CTXL-RR-6B | 74.2 | 71.9 | 73.8 | 55.2 | 69.1 | 60.7 | 68.1 | 51.2 | 65.5 |
| Jina-RR-v3 | 74.1 | 65.8 | 63.6 | 41.5 | 57.2 | 57.3 | 67.9 | 45.3 | 59.1 |
| Qwen3-RR-0.6B | 74.1 | 53.3 | 57.1 | 33.1 | 47.1 | 48.5 | 59.5 | 47.8 | 52.5 |
| Qwen3-RR-4B | 80.3 | 68.4 | 67.7 | 50.9 | 61.8 | 56.7 | 66.9 | 51.3 | 63.0 |
| Qwen3-RR-8B | 80.8 | 71.0 | 70.2 | 55.7 | 65.9 | 59.6 | 68.7 | 52.7 | 65.6 |
| RR4-Fast | 82.0 | 70.8 | 74.5 | 53.6 | 68.5 | 59.7 | 69.4 | 48.8 | 65.9 |
| RR4-Pro | 83.2 | 73.7 | 75.5 | 57.9 | 70.8 | 61.3 | 71.3 | 51.5 | 68.1 |
| Voyage2.5-lt | 83.8 | 73.2 | 74.7 | 57.2 | 69.5 | 62.0 | 70.2 | 48.8 | 67.4 |
| Voyage2.5 | 85.1 | 73.8 | 75.2 | 58.4 | 71.8 | 61.9 | 71.6 | 50.3 | 68.5 |
| zerank-1-sm | 84.3 | 69.6 | 72.9 | 52.8 | 66.7 | 58.6 | 67.4 | 48.6 | 65.1 |
| zerank-1 | 84.0 | 71.6 | 75.1 | 55.5 | 68.7 | 60.4 | 69.7 | 49.0 | 66.7 |
| zerank-2 | 84.1 | 72.4 | 75.1 | 55.8 | 68.8 | 60.7 | 69.7 | 49.0 | 67.0 |
qrel-nDCG@10 (%), rule (b): group-mean gain for ties
| Reranker | Comp. Sci. | Energy | Finance (en) | Finance (fr) | HR | Industrial | Pharma. | Physics | Mean |
|---|---|---|---|---|---|---|---|---|---|
| CTXL-RR-1B | 77.7 | 68.9 | 69.1 | 49.7 | 65.4 | 57.4 | 66.4 | 49.2 | 63.0 |
| CTXL-RR-2B | 76.7 | 71.6 | 71.7 | 53.2 | 68.1 | 61.1 | 67.5 | 49.0 | 64.9 |
| CTXL-RR-6B | 74.4 | 71.8 | 73.8 | 55.2 | 69.1 | 60.6 | 68.2 | 51.2 | 65.5 |
| Jina-RR-v3 | 74.1 | 65.8 | 63.6 | 41.5 | 57.2 | 57.3 | 67.9 | 45.3 | 59.1 |
| Qwen3-RR-0.6B | 74.4 | 53.3 | 57.3 | 34.2 | 45.2 | 49.7 | 60.0 | 47.9 | 52.8 |
| Qwen3-RR-4B | 80.4 | 67.9 | 67.4 | 51.0 | 61.7 | 57.8 | 66.4 | 51.0 | 62.9 |
| Qwen3-RR-8B | 80.8 | 70.6 | 70.3 | 55.5 | 65.5 | 60.0 | 68.6 | 52.3 | 65.4 |
| RR4-Fast | 81.9 | 70.7 | 74.5 | 53.6 | 68.5 | 59.7 | 69.5 | 48.8 | 65.9 |
| RR4-Pro | 83.2 | 73.7 | 75.5 | 57.9 | 70.8 | 61.3 | 71.4 | 51.5 | 68.2 |
| Voyage2.5-lt | 83.8 | 73.2 | 74.6 | 57.3 | 69.6 | 62.1 | 70.2 | 49.0 | 67.5 |
| Voyage2.5 | 85.1 | 74.0 | 75.1 | 58.5 | 71.9 | 62.1 | 71.6 | 50.3 | 68.6 |
| zerank-1-sm | 84.3 | 69.5 | 72.8 | 52.6 | 66.8 | 58.7 | 67.5 | 48.5 | 65.1 |
| zerank-1 | 84.0 | 71.7 | 75.1 | 55.4 | 68.7 | 60.4 | 69.7 | 48.9 | 66.7 |
| zerank-2 | 84.2 | 72.4 | 75.1 | 55.8 | 68.9 | 60.7 | 69.8 | 49.0 | 67.0 |
Mean over the 6 language subsets (the mteb task score)
RCP-nDCG@10 (%), rule (a): document-id tie-break
| Reranker | Comp. Sci. | Energy | Finance (en) | Finance (fr) | HR | Industrial | Pharma. | Physics | Mean |
|---|---|---|---|---|---|---|---|---|---|
| CTXL-RR-1B | 83.3 | 84.2 | 78.1 | 79.2 | 80.2 | 73.3 | 80.7 | 84.7 | 80.5 |
| CTXL-RR-2B | 85.5 | 87.2 | 83.3 | 81.5 | 85.8 | 81.5 | 85.3 | 86.8 | 84.6 |
| CTXL-RR-6B | 80.6 | 85.4 | 84.4 | 83.3 | 86.0 | 81.5 | 83.8 | 85.4 | 83.8 |
| Jina-RR-v3 | 71.7 | 70.1 | 64.8 | 63.9 | 65.8 | 68.1 | 75.3 | 76.2 | 69.5 |
| Qwen3-RR-0.6B | 78.6 | 77.0 | 68.5 | 63.1 | 70.0 | 69.5 | 74.5 | 82.3 | 72.9 |
| Qwen3-RR-4B | 87.2 | 85.2 | 77.6 | 79.1 | 82.1 | 79.4 | 83.3 | 88.1 | 82.8 |
| Qwen3-RR-8B | 88.4 | 88.2 | 81.1 | 83.9 | 84.6 | 82.0 | 85.4 | 89.1 | 85.3 |
| RR4-Fast | 87.8 | 88.7 | 84.5 | 83.4 | 84.0 | 79.7 | 85.3 | 88.4 | 85.2 |
| RR4-Pro | 90.8 | 92.5 | 88.0 | 90.2 | 89.1 | 86.1 | 88.2 | 92.1 | 89.6 |
| Voyage2.5-lt | 88.3 | 89.3 | 83.1 | 83.6 | 86.7 | 81.6 | 87.4 | 86.3 | 85.8 |
| Voyage2.5 | 92.0 | 92.8 | 84.9 | 87.2 | 90.2 | 85.7 | 89.7 | 90.8 | 89.2 |
| zerank-1-sm | 91.2 | 90.1 | 85.1 | 85.5 | 87.1 | 83.0 | 86.3 | 90.7 | 87.4 |
| zerank-1 | 92.8 | 92.7 | 86.9 | 89.0 | 90.4 | 86.7 | 89.5 | 92.9 | 90.1 |
| zerank-2 | 93.2 | 92.9 | 86.2 | 89.2 | 90.6 | 86.6 | 89.6 | 93.4 | 90.2 |
RCP-nDCG@10 (%), rule (b): group-mean gain for ties
| Reranker | Comp. Sci. | Energy | Finance (en) | Finance (fr) | HR | Industrial | Pharma. | Physics | Mean |
|---|---|---|---|---|---|---|---|---|---|
| CTXL-RR-1B | 83.3 | 84.2 | 78.1 | 79.1 | 80.3 | 73.3 | 80.7 | 84.7 | 80.5 |
| CTXL-RR-2B | 85.5 | 87.2 | 83.3 | 81.5 | 85.8 | 81.5 | 85.3 | 86.7 | 84.6 |
| CTXL-RR-6B | 80.6 | 85.4 | 84.4 | 83.3 | 86.0 | 81.5 | 83.8 | 85.4 | 83.8 |
| Jina-RR-v3 | 71.7 | 70.1 | 64.8 | 63.9 | 65.8 | 68.1 | 75.3 | 76.2 | 69.5 |
| Qwen3-RR-0.6B | 78.7 | 77.3 | 69.0 | 64.3 | 69.5 | 69.6 | 75.2 | 82.1 | 73.2 |
| Qwen3-RR-4B | 87.2 | 85.0 | 77.7 | 79.0 | 82.1 | 79.4 | 83.5 | 88.0 | 82.7 |
| Qwen3-RR-8B | 88.4 | 88.1 | 81.2 | 84.0 | 84.6 | 82.1 | 85.4 | 89.0 | 85.3 |
| RR4-Fast | 87.8 | 88.7 | 84.6 | 83.4 | 84.0 | 79.7 | 85.3 | 88.4 | 85.2 |
| RR4-Pro | 90.8 | 92.5 | 88.0 | 90.2 | 89.1 | 86.1 | 88.2 | 92.1 | 89.6 |
| Voyage2.5-lt | 88.2 | 89.3 | 83.2 | 83.6 | 86.7 | 81.6 | 87.4 | 86.3 | 85.8 |
| Voyage2.5 | 92.0 | 92.8 | 84.9 | 87.2 | 90.2 | 85.6 | 89.7 | 90.8 | 89.1 |
| zerank-1-sm | 91.2 | 90.1 | 85.1 | 85.5 | 87.1 | 83.0 | 86.3 | 90.7 | 87.4 |
| zerank-1 | 92.8 | 92.7 | 86.9 | 89.0 | 90.4 | 86.7 | 89.5 | 92.9 | 90.1 |
| zerank-2 | 93.2 | 92.9 | 86.2 | 89.2 | 90.6 | 86.6 | 89.6 | 93.4 | 90.2 |
qrel-nDCG@10 (%), rule (a): document-id tie-break
| Reranker | Comp. Sci. | Energy | Finance (en) | Finance (fr) | HR | Industrial | Pharma. | Physics | Mean |
|---|---|---|---|---|---|---|---|---|---|
| CTXL-RR-1B | 76.4 | 65.0 | 61.9 | 45.4 | 57.9 | 48.2 | 62.8 | 47.9 | 58.2 |
| CTXL-RR-2B | 76.9 | 69.3 | 67.3 | 50.6 | 64.2 | 56.8 | 66.1 | 47.4 | 62.3 |
| CTXL-RR-6B | 74.4 | 69.0 | 68.8 | 52.1 | 65.9 | 57.0 | 66.6 | 49.6 | 62.9 |
| Jina-RR-v3 | 71.0 | 62.0 | 55.2 | 40.2 | 50.4 | 50.1 | 65.1 | 44.9 | 54.9 |
| Qwen3-RR-0.6B | 69.8 | 50.8 | 48.7 | 30.3 | 43.4 | 43.4 | 55.8 | 46.7 | 48.6 |
| Qwen3-RR-4B | 78.5 | 67.2 | 63.1 | 49.9 | 61.3 | 54.5 | 65.1 | 50.8 | 61.3 |
| Qwen3-RR-8B | 80.4 | 69.4 | 66.7 | 53.8 | 63.5 | 57.2 | 67.5 | 52.2 | 63.8 |
| RR4-Fast | 79.3 | 68.7 | 68.6 | 52.3 | 62.3 | 54.1 | 67.2 | 48.4 | 62.6 |
| RR4-Pro | 82.0 | 73.2 | 73.3 | 57.5 | 68.1 | 60.1 | 70.2 | 51.3 | 67.0 |
| Voyage2.5-lt | 80.3 | 71.4 | 68.0 | 54.1 | 65.1 | 55.2 | 68.1 | 47.7 | 63.7 |
| Voyage2.5 | 83.9 | 73.3 | 71.6 | 57.5 | 68.8 | 58.0 | 69.6 | 49.5 | 66.5 |
| zerank-1-sm | 81.9 | 68.6 | 67.3 | 51.0 | 63.1 | 53.4 | 64.8 | 47.7 | 62.2 |
| zerank-1 | 82.9 | 71.2 | 70.7 | 54.5 | 66.7 | 57.4 | 67.8 | 47.8 | 64.9 |
| zerank-2 | 83.0 | 71.6 | 70.9 | 55.2 | 67.0 | 57.2 | 67.7 | 48.3 | 65.1 |
qrel-nDCG@10 (%), rule (b): group-mean gain for ties
| Reranker | Comp. Sci. | Energy | Finance (en) | Finance (fr) | HR | Industrial | Pharma. | Physics | Mean |
|---|---|---|---|---|---|---|---|---|---|
| CTXL-RR-1B | 76.4 | 65.0 | 61.9 | 45.4 | 57.9 | 48.3 | 62.8 | 47.9 | 58.2 |
| CTXL-RR-2B | 76.9 | 69.3 | 67.3 | 50.6 | 64.3 | 56.8 | 66.2 | 47.4 | 62.3 |
| CTXL-RR-6B | 74.4 | 69.0 | 68.8 | 52.1 | 66.0 | 57.0 | 66.6 | 49.6 | 62.9 |
| Jina-RR-v3 | 71.0 | 62.0 | 55.2 | 40.2 | 50.4 | 50.1 | 65.1 | 44.9 | 54.9 |
| Qwen3-RR-0.6B | 69.9 | 51.2 | 49.4 | 31.9 | 42.4 | 44.0 | 56.3 | 46.6 | 49.0 |
| Qwen3-RR-4B | 78.6 | 66.4 | 62.9 | 49.8 | 61.2 | 55.2 | 65.0 | 50.5 | 61.2 |
| Qwen3-RR-8B | 80.3 | 69.0 | 66.7 | 53.6 | 63.4 | 57.5 | 67.3 | 51.8 | 63.7 |
| RR4-Fast | 79.3 | 68.7 | 68.6 | 52.3 | 62.3 | 54.0 | 67.2 | 48.5 | 62.6 |
| RR4-Pro | 82.0 | 73.2 | 73.3 | 57.5 | 68.1 | 60.1 | 70.3 | 51.3 | 67.0 |
| Voyage2.5-lt | 80.3 | 71.4 | 68.0 | 54.1 | 65.1 | 55.2 | 68.1 | 47.8 | 63.7 |
| Voyage2.5 | 83.9 | 73.4 | 71.6 | 57.4 | 68.9 | 58.1 | 69.6 | 49.5 | 66.5 |
| zerank-1-sm | 81.9 | 68.5 | 67.3 | 51.0 | 63.2 | 53.4 | 64.9 | 47.7 | 62.2 |
| zerank-1 | 82.9 | 71.2 | 70.8 | 54.5 | 66.7 | 57.4 | 67.9 | 47.9 | 64.9 |
| zerank-2 | 83.0 | 71.7 | 70.9 | 55.2 | 67.0 | 57.2 | 67.7 | 48.4 | 65.1 |
Relation to the paper. These are the arXiv v2 numbers: the paper's ViDoRe table uses rule (b) on the
native-language questions (2,419), which is the native-language view under (b). Release 2 corrects how
the judge's tournament (Stage A) answers were read: v1 replaced answers its parser could not read with
rankings scraped from the response text and weighted them 5x in the fit, while v2 re-reads the judge's
own answers. This concerned 6,051 of 3,122,771 tournament windows, of which v2 recovered 6,024. A
tournament window now enters the fit only when the answer gives a complete ranking and a score for every
document: release 2 leaves out the 27 answers it still cannot read and 2,322 answers that rank or score
only some of their documents, which release 1 had fitted. Release 2 also applies the release rule to the
rubric (Stage B) answers: an answer that does not give all five criteria for every document it shows is
left out (11 of 1,451,399 rubric windows), which is why provenance-judge-criteria has 99 fewer rows
than in release 1. The 2PL fit was then redone, so the RCP-nDCG@10 cells change; qrel-nDCG@10 does not
depend on the judge and is unchanged. Rule (a) gives the same view within 0.7 points on RCP-nDCG@10 (32
of 126 printed values differ) and within 1.9 points on qrel-nDCG@10 (64 of 126).
Native language vs the mteb task score. The mteb score averages the six language subsets (14,514 questions). Under rule (b), it lies on average 1.9 RCP-nDCG@10 points below the native-language number (per cell −8.2 to +2.6), and 2.7 qrel-nDCG@10 points below it (−9.1 to +0.1).
Effect of the tie rule. Per cell, the document-id rule (a) differs from the paper's rule (b) by at most 0.64 points on RCP-nDCG@10 in the native view, and by at most 1.2 points in the six-language view. On average, (a) minus (b) is −0.01 and −0.02 points. On qrel-nDCG@10 the maxima are 1.81 and 1.62 points.
Rerankers (hub model in provenance-runs): CTXL-RR-1B = ctxl-rerank-v2-instruct-multilingual-1b, CTXL-RR-2B = ctxl-rerank-v2-instruct-multilingual-2b, CTXL-RR-6B = ctxl-rerank-v2-instruct-multilingual-6b, Jina-RR-v3 = jina-reranker-v3, Qwen3-RR-0.6B = Qwen3-Reranker-0.6B, Qwen3-RR-4B = Qwen3-Reranker-4B, Qwen3-RR-8B = Qwen3-Reranker-8B, RR4-Fast = rerank-v4.0-fast, RR4-Pro = rerank-v4.0-pro, Voyage2.5-lt = rerank-2.5-lite, Voyage2.5 = rerank-2.5, zerank-1-sm = zerank-1-small, zerank-1 = zerank-1, zerank-2 = zerank-2.
Known data notes
- Language cannot be derived from row position. 5 of 8 domains have two batches of 6 language
blocks. Always use the
languageof the upstream query, as the subsets here do. - Some pages have byte-identical OCR text: 56 groups covering 181 pages, most in pharmaceuticals (26 groups, 84 pages). In 12 groups (pharmaceuticals 11, physics 1), identical pages carry different qrels.
- 264 pages have empty OCR text (industrial 205, finance_en 19, energy 15, hr 12, finance_fr 11, computer_science 2), so a text first stage can never retrieve them. None is in any pool or relevant to any query.
Licence and attribution
Derived from ViDoRe v3 (Loison et al., 2026), CC-BY-4.0. The
corpus, queries and qrels are redistributed unchanged. The provenance-runs scores come from
third-party reranker models and APIs, and the gains come from an LLM judge's outputs; check those
providers' terms before any public or commercial reuse. Please cite ViDoRe v3 alongside RCP-nDCG:
@article{loison2026vidorev3comprehensiveevaluation,
author = {António Loison and Quentin Macé and Antoine Edy and Victor Xing and Tom Balough and Gabriel Moreira and Bo Liu and Manuel Faysse and Céline Hudelot and Gautier Viaud},
title = {ViDoRe V3: A Comprehensive Evaluation of Retrieval Augmented Generation in Complex Real-World Scenarios},
journal = {arXiv preprint arXiv:2601.08620},
year = {2026},
}
Please also cite RCP-nDCG (arXiv:2609.35739):
@misc{schmidt2026rcp,
title = {Rubric-Calibrated Preferences: Cross-Query Calibration of LLM Judgments via Item Response Theory},
author = {Schmidt, Fabian David and Crisostomi, Donato and Lassance, Carlos and Reimers, Nils},
year = {2026},
eprint = {2609.35739},
archiveprefix = {arXiv},
primaryclass = {cs.IR},
url = {https://arxiv.org/abs/2609.35739},
}
The blind human study and the external LLM-judge comparisons that validate RCP-nDCG are released in
fabianschmidt-cohere/rcp-ndcg-external-validation.
- Downloads last month
- 4,417