Wiki source code of Requête en langage naturel
Last modified by Aurelie Bertrand on 2025/02/07 10:09
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{ddtoc/}} | ||
2 | |||
3 | = Prerequisites = | ||
4 | |||
5 | * Cubes in your wallets recently synchronized | ||
6 | |||
7 | = Creating flows with text query = | ||
8 | |||
9 | Digdash offers the possibility to create flows in some clicks with natural language. | ||
10 | |||
11 | * Via the dashboards editor | ||
12 | |||
13 | |[[image:text_query_en_html_f2d69e963b6dfe7b.png||height="177" width="275"]] | ||
14 | |**Dashboards editor **>** Creating new graphics **>** In natural language** | ||
15 | |[[image:text_query_en_html_d3b55a8e10123fdd.png||height="207" width="266"]] | ||
16 | |In the showing dialog, you can enter you query in the search bar. | ||
17 | |[[image:text_query_en_html_98fd1f57c633562.png||height="184" width="318"]] | ||
18 | |Choose a flow in the results list (we are going to pick the first one) | ||
19 | |[[image:text_query_en_html_c8e99a6b1e0bc9e9.png||height="170" width="355"]] | ||
20 | |And save the flow in the current wallet. | ||
21 | |[[image:text_query_en_html_cddc52d001b3a1e9.png||height="213" width="355"]] | ||
22 | |Give a name to your flow. | ||
23 | |[[image:text_query_en_html_f70ed4175e1093f9.png||height="175" width="355"]] | ||
24 | |The new flow will be added to your dashboard editor and you will find it in the existing graphics list. | ||
25 | |||
26 | * Via the dashboard | ||
27 | |||
28 | It is also possible to add a « Text query » element in your dashboard in order to create flows on the fly. | ||
29 | |||
30 | |[[image:text_query_en_html_21e80dc5c36d4220.png||height="468" width="202"]] | ||
31 | |**Dashboards editor **>** Additional content **>** Elements **>** Text query** | ||
32 | |[[image:text_query_en_html_f940b7f7ead63723.png||height="223" width="325"]] | ||
33 | |Add the element in your dashboard editor. | ||
34 | |[[image:text_query_en_html_81f6639240d4c264.png||height="193" width="288"]] | ||
35 | |((( | ||
36 | According to your query, you may filter on some measures/dimensions. | ||
37 | |||
38 | You would better have a « Filtered elements » element in your dashboard to remove these filters for the potential next queries. | ||
39 | |||
40 | **Dashboard editors **>** Additional content **>** Elements **>** Filtered elements** | ||
41 | ))) | ||
42 | |[[image:text_query_en_html_758db70155096f91.png||height="123" width="325"]] | ||
43 | |You will find those elements dashboard side. | ||
44 | |||
45 | {{{ | ||
46 | }}} | ||
47 | |||
48 | = Composition of a text query = | ||
49 | |||
50 | Digdash allows you to create flows from data models in natural language. | ||
51 | |||
52 | Digdash mainly rests on keywords to suggest you the most relevant flows and the names of your data models’ columns. | ||
53 | |||
54 | So a query is basically composed of measures names from your data model and/or dimensions names, followed (or not) by flows names and/or sorting operations. | ||
55 | |||
56 | We shall later explain how important query terms are important. | ||
57 | |||
58 | = Results for a text query = | ||
59 | |||
60 | [[image:text_query_en_html_c7eda020d25db863.png||height="117" width="550"]] | ||
61 | |||
62 | |||
63 | //__Screenshot: Results for a text query__// | ||
64 | |||
65 | Results for a text query are presented in list, with its associated flow, sorted by its relevance and a score. The more the score is high, the more the suggested flow is considered as relevant. Also, the cube name is mentioned so is a description of the flow. | ||
66 | |||
67 | We shall later see in this document which are the criteria that could have an influence on the score of a result. | ||
68 | |||
69 | = Choices of graphics = | ||
70 | |||
71 | For a given query, you will be suggested a list of results of multiple graphics, depending on your query members. | ||
72 | |||
73 | Nevertheless, you can require a particular graphic, as long as it remains coherent (the query « Cost in line » has no sense). | ||
74 | |||
75 | The numbers of members for a cube has an incidence. Indeed, when a query, even coherent, has too many members to show, you will be suggested a more adapted graphic. | ||
76 | |||
77 | Here are the keywords to use for the choice of graphics: | ||
78 | |||
79 | |**Charts name**|**Keywords** | ||
80 | |Pie chart|« pie » | ||
81 | |Gauge|« gauge » | ||
82 | |Progress bar|« progress bar » | ||
83 | |Energy bars|« energy » | ||
84 | |Arrow indicator|« arrow » | ||
85 | |Column chart|((( | ||
86 | « column » | ||
87 | |||
88 | « histogram » | ||
89 | ))) | ||
90 | |Bar chart|« bar » | ||
91 | |Map chart|« map » | ||
92 | |Scatter chart|« scatter » | ||
93 | |Bubble chart|« bubble » | ||
94 | |Line chart|« line » | ||
95 | |Zone chart|((( | ||
96 | « area » | ||
97 | |||
98 | « zone » | ||
99 | ))) | ||
100 | |Radar chart|« radar » | ||
101 | |Tab chart|« table » | ||
102 | |Indicator|« indicator » | ||
103 | |{{glossaryReference glossaryId="Glossary" entryId="Tableau croisé"}}Cross table{{/glossaryReference}}|« cross table » | ||
104 | |Text chart|« text » | ||
105 | |||
106 | //__Table presenting keywords for the different flows__// | ||
107 | |||
108 | = Sorting = | ||
109 | |||
110 | It is possible for you to use sorting operations with the following keywords : | ||
111 | |||
112 | |**Sorting**|**Keywords**|**Queries examples** | ||
113 | |Ascending|((( | ||
114 | « sort » (ascending) | ||
115 | |||
116 | « sorted » (ascending) | ||
117 | |||
118 | « ascending » | ||
119 | )))|((( | ||
120 | « Cost by region in France in 2006 sorted by cost in table » | ||
121 | |||
122 | « Cost by region in France in 2006 sorted in table » | ||
123 | |||
124 | « Cost by region in France in 2006 ascending in table » | ||
125 | |||
126 | « Cost by region in France in 2006 sorted in ascending order in table » | ||
127 | ))) | ||
128 | |Descending|((( | ||
129 | « sort » (descending) | ||
130 | |||
131 | « sorted » (descending) | ||
132 | |||
133 | « descending » | ||
134 | )))|((( | ||
135 | « Cost by region in France in 2006 sorted by cost in table » | ||
136 | |||
137 | « Cost by region in France in 2006 descending in table » | ||
138 | |||
139 | « Cost by region in France in 2006 sorted in descending order in table » | ||
140 | ))) | ||
141 | |||
142 | //__Table presenting keywords for sorting operations__// | ||
143 | |||
144 | |||
145 | = Trend of a measure = | ||
146 | |||
147 | A measure has a trend. It can be stable (trend by default), increasing or decreasing: | ||
148 | |||
149 | {{{ | ||
150 | }}} | ||
151 | |||
152 | |**Tendance**|**Signification** | ||
153 | |STABLE|Default trend: The bigger the better | ||
154 | |INCREASING|((( | ||
155 | The bigger the better | ||
156 | |||
157 | //Example : for a quality// | ||
158 | ))) | ||
159 | |DECREASING|((( | ||
160 | The lowest the better | ||
161 | |||
162 | //Example : for a cost// | ||
163 | ))) | ||
164 | |||
165 | __//Table presenting possible trends for a measure//__ | ||
166 | |||
167 | You can change the trend of a measure via the Digdash Enterprise Studio, in the data source advanced configuration, in the properties part of a measure. | ||
168 | |||
169 | |||
170 | //__Definition of a measure’s trend in Digdash’s Studio Enterprise__// | ||
171 | |||
172 | * Impact of a measure’s trend | ||
173 | |||
174 | Trend has an impact on the sorting order. Indeed, if the type of sorting is not explicitly mentioned, the kind of sorting will be based on the measure’s trend. Consequently, we will get an ascending sort for a stable or increasing trend and a descending sort for a decreasing trend. | ||
175 | |||
176 | |||
177 | |||
178 | |**Trend**|**Queries examples**|**Sort** | ||
179 | |STABLE|((( | ||
180 | « Duration by state sorted » | ||
181 | |||
182 | Duration is a measure with a stable trend | ||
183 | )))|//The sorting of measure Duration on dimension state will be descendant// | ||
184 | |INCREASING|((( | ||
185 | « Quality by state sorted » | ||
186 | |||
187 | Quality is a measure with an increasing trend | ||
188 | )))|//The sorting of measure Quality on dimension state will be descendant// | ||
189 | |DECREASING|((( | ||
190 | « Cost by state sorted » | ||
191 | |||
192 | Cost is a measure with a decreasing trend | ||
193 | )))|//The sorting of measure Cost on dimension state will be ascendant// | ||
194 | |||
195 | //__Table with examples presenting impact of a measure’s trend on sorting orders__// | ||
196 | |||
197 | {{{ | ||
198 | }}} | ||
199 | |||
200 | = The best / the worst, the top / bottom = | ||
201 | |||
202 | It is possible to get the X best/worst members of the results of your query using these keywords: | ||
203 | |||
204 | |**Cases**|**Keywords**|**Example** | ||
205 | |The X best|((( | ||
206 | « Top » | ||
207 | |||
208 | « biggest » | ||
209 | |||
210 | « best » | ||
211 | )))|((( | ||
212 | The best cost in France | ||
213 | |||
214 | The 5 best costs in 2016 | ||
215 | |||
216 | The 2 biggest costs in Europe | ||
217 | |||
218 | Top 3 of costs in France in 2016 | ||
219 | ))) | ||
220 | |The X worst|((( | ||
221 | « Worst » | ||
222 | |||
223 | « bottom » | ||
224 | |||
225 | « smallest » | ||
226 | )))|((( | ||
227 | The worst cost in France | ||
228 | |||
229 | The 5 worst costs in 2016 | ||
230 | |||
231 | The 2 smallest costs in Europe | ||
232 | ))) | ||
233 | |||
234 | //__Table presenting keywords for best/worst, top/bottom__// | ||
235 | |||
236 | |||
237 | = Aggregation = | ||
238 | |||
239 | You can define an aggregation method for the measures of your query using these keywords : | ||
240 | |||
241 | |**Aggregation**|**Keywords**|**Queries examples** | ||
242 | |Sum|« sum »|« Sum of cost » | ||
243 | |Average|« average »|« Average of cost » | ||
244 | |Minimum|« min »|« Min of cost » | ||
245 | |Maximum|« max »|« Max of cost » | ||
246 | |||
247 | //__Table presenting keywords for aggregation__// | ||
248 | |||
249 | |||
250 | = Targets = | ||
251 | |||
252 | It is possible to apply targets on measures mentioning the following keyword : | ||
253 | |||
254 | |||
255 | |**Keyword** | ||
256 | |« target » | ||
257 | |||
258 | __//Table presenting the keyword for targets//__ | ||
259 | |||
260 | |||
261 | You can also directly mention the name of the targets you want to apply. | ||
262 | |||
263 | |||
264 | |**Example** | ||
265 | |Given a data model with the following columns((( | ||
266 | |**Dimensions**|**Measures** | ||
267 | |Date|Quality | ||
268 | |Type of line|Cost (with target « Targ ») | ||
269 | ))) | ||
270 | |((( | ||
271 | Example 1 : « Cost in gauge with target » | ||
272 | |||
273 | * Every measure has one target applied on it. | ||
274 | |||
275 | Example 2 : « Cost in gauge avec Obj » | ||
276 | |||
277 | * The target « Targ » is applied on the associated measure « Cost ». | ||
278 | ))) | ||
279 | |||
280 | __//Table with example presenting the use of target in text query//__ | ||
281 | |||
282 | |||
283 | = Use of synonyms = | ||
284 | |||
285 | Text query takes in charge synonyms of your query members. | ||
286 | |||
287 | == Creating synonyms dictionaries == | ||
288 | |||
289 | To use synonyms in text query, you first need to import a synonyms dictionary in Digdash. | ||
290 | |||
291 | Please refer to the documentation called « synonyms_dictionary_en.pdf » to import a synonyms dictionary in Digdash. | ||
292 | |||
293 | == Activating synonyms dictionaries == | ||
294 | |||
295 | You then need to check if the use of synonyms dictionaries is activated for text query in the server configuration. | ||
296 | |||
297 | [[image:text_query_en_html_d057beaef5d1f988.png||height="238" width="444"]] | ||
298 | \\ | ||
299 | |||
300 | [[image:text_query_en_html_f1d5ad7376929373.png||height="241" width="413"]] | ||
301 | \\ | ||
302 | |||
303 | In the server configuration page, at the bottom of the page > **Advanced >>** > Category **Synonyms dictionaries** > Checkbox **Use synonyms dictionaries for text query** | ||
304 | |||
305 | [[image:text_query_en_html_f1e4eedd6b1df4.png||height="114" width="508"]] | ||
306 | \\ | ||
307 | |||
308 | //__Screenshot: Activation of the use of synonyms dictionaries for text query__// | ||
309 | |||
310 | == Use case == | ||
311 | |||
312 | |**Example** | ||
313 | |Given a data model with the following columns((( | ||
314 | |**Dimensions**|**Measures** | ||
315 | |Date|Quality | ||
316 | |Type of line|Cost | ||
317 | ))) | ||
318 | |((( | ||
319 | In that case, the query | ||
320 | |||
321 | « Price by sort of line » | ||
322 | |||
323 | is equivalent to th query | ||
324 | |||
325 | « Cost by type of line » | ||
326 | |||
327 | (« price » is a synonym of « cost » and « sort » is a synonym of « type »). | ||
328 | |||
329 | __**NB**__ : This is valid only if your synonyms dictionaries contains these synonyms. | ||
330 | ))) | ||
331 | |||
332 | //__Table with example presenting a use case of text query with synonyms__// | ||
333 | |||
334 | = Scores for a result of a text query = | ||
335 | |||
336 | Queries results are ordered according to their relevance and the best score can reach a 5 out of 5. | ||
337 | |||
338 | The score for a result may vary for different reasons. | ||
339 | |||
340 | * Importance of the query members | ||
341 | |||
342 | Indeed, a result will be better marked if the query is composed of the exact columns’ names of your data models. | ||
343 | |||
344 | A query is then considered as less good if it contains partial names of your columns, or synonyms. | ||
345 | |||
346 | |(% colspan="3" %)**Example** | ||
347 | |(% colspan="3" %)Given a data model with these columns((( | ||
348 | |**Dimensions**|**Measures** | ||
349 | |Date|Quality | ||
350 | |Type of line|Cost | ||
351 | |||
352 | |||
353 | ))) | ||
354 | |((( | ||
355 | **Query 1 :** | ||
356 | |||
357 | **With the exact names** | ||
358 | )))|((( | ||
359 | **Query 2 :** | ||
360 | |||
361 | **With partial names** | ||
362 | )))|((( | ||
363 | **Query 3 :** | ||
364 | |||
365 | **With synonyms** | ||
366 | ))) | ||
367 | |« Cost by type of line »|« Cost by type »|« Price by sort of line » | ||
368 | |With only exact terms, the results can be well-marked.|With partial names, the results can be less well-marked.|((( | ||
369 | « price » is a synonym of « cost », « sort of line » is a synonym of « type of line ». | ||
370 | |||
371 | This query is different from the original query, the score will be low. | ||
372 | ))) | ||
373 | |Score* : 5/5|Score* : 3/5|Score* : 2/5 | ||
374 | |(% colspan="3" %)* indicated scoes are just to illustrate our example | ||
375 | |||
376 | //__Table with example presenting how important query members are important__// | ||
377 | |||
378 | * Importance of the suggested type of graphics | ||
379 | |||
380 | The results list for a query suggests graphics more or less relevant for what is expected. Given the nature of the query members, some flows will be considered less relevant, hence a lower score for them. | ||
381 | |||
382 | |||
383 |