Nihal Nayak commited on
Commit
44cf124
1 Parent(s): bb04fc2

example context

Browse files
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -66,37 +66,34 @@ task_types = [
66
  task_types = [task_type.capitalize() for task_type in task_types]
67
 
68
  description = """
69
- ## Bonito
70
  This is a demo for Bonito, an open-source model for conditional task generation that can generate synthetic instruction tuning datasets for a wide range of NLP tasks.
71
 
72
- ## Instructions
73
- Try out the model by entering a context and selecting a task type from the dropdown. The model will generate a task instruction based on the context and task type you provide.
74
-
75
- ## More details
76
  Model: https://huggingface.co/BatsResearch/bonito-v1
77
-
78
  Paper: https://arxiv.org/abs/2402.18334
79
-
80
  GitHub: https://github.com/BatsResearch/bonito
81
 
82
-
 
83
  """
84
 
85
  examples = [[
86
  (
87
  """2.3 Provided that the Recipient has a written agreement with the following persons or entities requiring them to treat the Confidential Information in accordance with this Agreement, the Recipient may disclose the Confidential Information to: 2.3.1 Any other party with the Discloser's prior written consent; and 2.3.2 the Recipient's employees, officials, representatives and agents who have a strict need to know the contents of the Confidential Information, and employees, officials, representatives and agents of any legal entity that it controls, controls it, or with which it is under common control, who have a similar need to know the contents of the Confidential Information, provided that, for these purposes a controlled legal entity means:""",
88
- "Natural language inference",
89
  ),
90
  (
91
- """Chronic rhinosinusitis (CRS) is a heterogeneous disease with an uncertain pathogenesis. Group 2 innate lymphoid cells (ILC2s) represent a recently discovered cell population which has been implicated in driving Th2 inflammation in CRS; however, their relationship with clinical disease characteristics has yet to be investigated. The aim of this study was to identify ILC2s in sinus mucosa in patients with CRS and controls and compare ILC2s across characteristics of disease. A cross-sectional study of patients with CRS undergoing endoscopic sinus surgery was conducted. Sinus mucosal biopsies were obtained during surgery and control tissue from patients undergoing pituitary tumour resection through transphenoidal approach. ILC2s were identified as CD45(+) Lin(-) CD127(+) CD4(-) CD8(-) CRTH2(CD294)(+) CD161(+) cells in single cell suspensions through flow cytometry. ILC2 frequencies, measured as a percentage of CD45(+) cells, were compared across CRS phenotype, endotype, inflammatory CRS subtype and other disease characteristics including blood eosinophils, serum IgE, asthma status and nasal symptom score. 35 patients (40% female, age 48 ± 17 years) including 13 with eosinophilic CRS (eCRS), 13 with non-eCRS and 9 controls were recruited. ILC2 frequencies were associated with the presence of nasal polyps (P = 0.002) as well as high tissue eosinophilia (P = 0.004) and eosinophil-dominant CRS (P = 0.001) (Mann-Whitney U). They were also associated with increased blood eosinophilia (P = 0.005). There were no significant associations found between ILC2s and serum total IgE and allergic disease. In the CRS with nasal polyps (CRSwNP) population, ILC2s were increased in patients with co-existing asthma (P = 0.03). ILC2s were also correlated with worsening nasal symptom score in CRS (P = 0.04).""",
92
  "Yes-no question answering",
93
  ),
94
  ]]
95
 
 
 
96
  demo = gr.Interface(
97
  fn=respond,
98
  inputs=[
99
- gr.Textbox(label="Context", lines=5, placeholder="Enter context here.."),
100
  gr.Dropdown(
101
  task_types,
102
  value="Natural language inference",
@@ -123,7 +120,6 @@ demo = gr.Interface(
123
  ],
124
  title="Bonito",
125
  description=description,
126
- examples=examples,
127
  )
128
 
129
 
 
66
  task_types = [task_type.capitalize() for task_type in task_types]
67
 
68
  description = """
 
69
  This is a demo for Bonito, an open-source model for conditional task generation that can generate synthetic instruction tuning datasets for a wide range of NLP tasks.
70
 
71
+ ## More details on Bonito
 
 
 
72
  Model: https://huggingface.co/BatsResearch/bonito-v1
 
73
  Paper: https://arxiv.org/abs/2402.18334
 
74
  GitHub: https://github.com/BatsResearch/bonito
75
 
76
+ ## Instructions
77
+ Try out the model by entering a context and selecting a task type from the dropdown. The model will generate a task instruction based on the context and task type you provide.
78
  """
79
 
80
  examples = [[
81
  (
82
  """2.3 Provided that the Recipient has a written agreement with the following persons or entities requiring them to treat the Confidential Information in accordance with this Agreement, the Recipient may disclose the Confidential Information to: 2.3.1 Any other party with the Discloser's prior written consent; and 2.3.2 the Recipient's employees, officials, representatives and agents who have a strict need to know the contents of the Confidential Information, and employees, officials, representatives and agents of any legal entity that it controls, controls it, or with which it is under common control, who have a similar need to know the contents of the Confidential Information, provided that, for these purposes a controlled legal entity means:""",
83
+ """Chronic rhinosinusitis (CRS) is a heterogeneous disease with an uncertain pathogenesis. Group 2 innate lymphoid cells (ILC2s) represent a recently discovered cell population which has been implicated in driving Th2 inflammation in CRS; however, their relationship with clinical disease characteristics has yet to be investigated. The aim of this study was to identify ILC2s in sinus mucosa in patients with CRS and controls and compare ILC2s across characteristics of disease. A cross-sectional study of patients with CRS undergoing endoscopic sinus surgery was conducted. Sinus mucosal biopsies were obtained during surgery and control tissue from patients undergoing pituitary tumour resection through transphenoidal approach. ILC2s were identified as CD45(+) Lin(-) CD127(+) CD4(-) CD8(-) CRTH2(CD294)(+) CD161(+) cells in single cell suspensions through flow cytometry. ILC2 frequencies, measured as a percentage of CD45(+) cells, were compared across CRS phenotype, endotype, inflammatory CRS subtype and other disease characteristics including blood eosinophils, serum IgE, asthma status and nasal symptom score. 35 patients (40% female, age 48 ± 17 years) including 13 with eosinophilic CRS (eCRS), 13 with non-eCRS and 9 controls were recruited. ILC2 frequencies were associated with the presence of nasal polyps (P = 0.002) as well as high tissue eosinophilia (P = 0.004) and eosinophil-dominant CRS (P = 0.001) (Mann-Whitney U). They were also associated with increased blood eosinophilia (P = 0.005). There were no significant associations found between ILC2s and serum total IgE and allergic disease. In the CRS with nasal polyps (CRSwNP) population, ILC2s were increased in patients with co-existing asthma (P = 0.03). ILC2s were also correlated with worsening nasal symptom score in CRS (P = 0.04).""",
84
  ),
85
  (
86
+ "Natural language inference",
87
  "Yes-no question answering",
88
  ),
89
  ]]
90
 
91
+ example_context = """2.3 Provided that the Recipient has a written agreement with the following persons or entities requiring them to treat the Confidential Information in accordance with this Agreement, the Recipient may disclose the Confidential Information to: 2.3.1 Any other party with the Discloser's prior written consent; and 2.3.2 the Recipient's employees, officials, representatives and agents who have a strict need to know the contents of the Confidential Information, and employees, officials, representatives and agents of any legal entity that it controls, controls it, or with which it is under common control, who have a similar need to know the contents of the Confidential Information, provided that, for these purposes a controlled legal entity means:"""
92
+
93
  demo = gr.Interface(
94
  fn=respond,
95
  inputs=[
96
+ gr.Textbox(label="Context", lines=5, placeholder="Enter context here..", value=example_context),
97
  gr.Dropdown(
98
  task_types,
99
  value="Natural language inference",
 
120
  ],
121
  title="Bonito",
122
  description=description,
 
123
  )
124
 
125