Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added WIKI takeover feature #57

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

thanawan-atc
Copy link

Enable Chirpy to capture human non-linear conversational flow by allowing WIKI to takeover rg when there exists entities that can be linked with Wikipedia data. After WIKI is done with discussing the takeover_entity, it will handback control to the previously active rg and resume the conversation. Note that the takeover text is generated by looking up the spans of the takeover entity in the wiki page of the entity being taken over. If none of the texts are found, it will find the spans of the entity being taken over mentioned in the wiki page of takeover entity. If it still returns None, it will use neural response instead. However, if the neural response is not relevant enough, WIKi rg will return None and the takeover will not occur. (logging_rich available in ChirpyCardinal-2021 is added to this file as well).

The main changes that are made are:

  • Adding talk_unfinished (to keep track of the entity that is taken over) & able_to_takeover_entities (to find the takeover_entity for triggering takeover_treelet) attributes to EntityTrackerState.
  • Adding archived_state attribute (to mark where we leave off so that Chirpy can resume conversation when the control is handed back), rg_that_was_taken_over, and takeover_entity to State and ConditionalState object.
  • Adding last_rg_willing_to_handover_control and last_rg_willing_to_handback_control attributes to ResponseGeneratorResult to specify where we allow taking over and handing back control to happen
  • Using get_prompt_wrapper instead of just get_prompt so that rg can create a special prompt for resuming conversation by calling resume_conversation function.
  • Creating takeover_treelet and handback_treelet in WIKI to carry out taking over process
  • Adding get_takeover_response function to WIKI rg to get response from takeover_treelet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant