usersimcrs.core.information_need

Interface to represent an information need.

The information need comprises three elements: constraints, requests, and target items. The constraints specify the slot-value pairs that the item of interest must satisfy, while the requests specify the slots for which the user wants information. The target items represent the “ground truth” items that the user is interested in.

Classes

InformationNeed

Initializes an information need.

Functions

generate_random_information_need(→ InformationNeed)

Generates a random information need based on the domain.

Module Contents

usersimcrs.core.information_need.generate_random_information_need(domain: usersimcrs.core.simulation_domain.SimulationDomain, item_collection: usersimcrs.items.item_collection.ItemCollection) InformationNeed

Generates a random information need based on the domain.

It randomly selects one target item and sets constraints and requests slots. The value of constraints are derived from the target’s properties. The number of constraints and requests are also randomly determined.

Parameters:
  • domain – Domain knowledge.

  • item_collection – Collection of items.

Returns:

Information need.

class usersimcrs.core.information_need.InformationNeed(target_items: List[usersimcrs.items.item.Item], constraints: Dict[str, Any], requests: List[str])

Initializes an information need.

Parameters:
  • target_items – Items that the user is interested in.

  • constraints – Slot-value pairs representing constraints on the item of interest.

  • requests – Slots representing the desired information.

get_constraint_value(slot: str) Any

Returns the value of a constraint slot.

Parameters:

slot – Slot.

Returns:

Value of the slot.

get_requestable_slots() List[str]

Returns the list of requestable slots.