-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.view.lkml
116 lines (97 loc) · 2.54 KB
/
scripts.view.lkml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
view: scripts {
sql_table_name: game_of_thrones_19.lines ;;
dimension: id {
type: number
primary_key: yes
hidden: yes
sql: ${TABLE}.id ;;
}
# dimension: unique_line_id {
# primary_key: yes
# type: string
# sql: concat(${episode},CAST(${linenum} AS STRING)) ;;
# }
dimension: episode {
hidden: yes
label: "Episode"
description: "Episode Title"
type: string
sql: ${TABLE}.episode ;;
}
dimension: linenum {
label: "Line Number"
description: "The number of the line within the episode, chronologically"
#The number of the line within the episode-- Ordering.
type: number
sql: ${TABLE}.linenum ;;
}
dimension: line {
label: "Line"
description: "Actual words spoken"
type: string
sql: ${TABLE}.line ;;
}
dimension: speaker_raw {
#Character Name. SCENEDIR for scene direction lines.
hidden: yes
type: string
sql:
${TABLE}.speaker;;
}
dimension: speaker {
description: "Character Name who Spoke. 'SCENEDIR' for scene directions"
type: string
sql: ${TABLE}.speaker ;;
}
##SENTIMENT ANALYSIS, DONE USING VADER
dimension: sentiment {
description: "Sentiment of line, calculated using VADER (https://github.com/cjhutto/vaderSentiment)"
type: number
sql: ${TABLE}.compound ;;
}
measure: average_sentiment {
label: "Average Sentiment of lines"
description: "Sentiment calculated using VADER (https://github.com/cjhutto/vaderSentiment)"
type: average
sql: ${sentiment} ;;
drill_fields: [detail*]
}
measure: count_negative_lines {
label: "Number of Negative Lines"
description: "Sentiment calculated using VADER (https://github.com/cjhutto/vaderSentiment)"
type: count
filters: {
field: sentiment
value: "<0"
}
drill_fields: [detail*]
}
measure: count_positive_lines {
label: "Number of Positive lines"
description: "Sentiment calculated using VADER (https://github.com/cjhutto/vaderSentiment)"
type: count
filters: {
field: sentiment
value: ">0"
}
drill_fields: [detail*]
}
measure: count_neutral_lines {
label: "Number of Neutral Lines"
description: "Sentiment calculated using VADER (https://github.com/cjhutto/vaderSentiment)"
type: count
filters: {
field: sentiment
value: "0"
}
drill_fields: [detail*]
}
measure: count {
label: "Count of all lines"
type: count
drill_fields: [detail*]
}
set: detail {
fields: [episode,linenum,line,speaker,sentiment]
}
}