1 PACKAGE ctx_entity AUTHID current_user AS
2
3
4 LOCK_WAIT constant number := 0;
5 LOCK_NOWAIT constant number := 1;
6 LOCK_NOWAIT_ERROR constant number := 2;
7
8 COMPILE_ALL constant number := 0;
9 COMPILE_RULES constant number := 1;
10 COMPILE_STOP_ENTITIES constant number := 2;
11
12 STATUS_NOTCOMPILED constant number := 0;
13 STATUS_TOBEDELETED constant number := 1;
14 STATUS_COMPILED constant number := 2;
15 STATUS_SUBSET constant number := 3;
16
17
18 /*------------------------------- TYPE DEFINITIONS ------------------------*/
19
20
21 /*---------------------------- create_extract_policy ----------------------*/
22 /*
23 NAME
24 create_extract_policy
25
26 DESCRIPTION
27 create an entity-extraction policy
28
29 ARGUMENT
30 policy_name - the name for the new policy
31 lexer - the lexer preference to use
32 storage_clause - storage preferences (still undecided)
33 include_supplied_rules - specify whether supplied rules are included
34 in compilation of user-defined rules
35 include_supplied_dictionary - specify whether supplied dictionary is used
36 in entity extraction
37 include_machine_learning - specify whether machine learning is included
38 in entity extraction
39
40 */
41
42 PROCEDURE create_extract_policy(
43 policy_name IN VARCHAR2,
44 lexer IN VARCHAR2 DEFAULT NULL,
45 include_supplied_rules IN BOOLEAN DEFAULT TRUE,
46 include_supplied_dictionary IN BOOLEAN DEFAULT TRUE
47 );
48 PRAGMA SUPPLEMENTAL_LOG_DATA(create_extract_policy, AUTO);
49
50 /*---------------------------- drop_extract_policy ------------------------*/
51 /*
52 NAME
53 drop_extract_policy
54
55 DESCRIPTION
56 drop an entity-extraction policy
57
58 ARGUMENT
59 policy_name - the name of the policy
60 */
61
62 PROCEDURE drop_extract_policy(
63 policy_name IN VARCHAR2
64 );
65 PRAGMA SUPPLEMENTAL_LOG_DATA(drop_extract_policy, AUTO);
66
67 /*---------------------------- add_extract_rule --------------------------*/
68 /*
69 NAME
70 add_extract_rule
71
72 DESCRIPTION
73 add a user-defined extraction rule to a policy object
74
75 ARGUMENT
76 policy_name - policy to associate rule with
77 rule_id - a unique rule_id within the extract policy
78 extraction_rule - specify the extraction rule to be added
79 */
80
81 PROCEDURE add_extract_rule(
82 policy_name IN VARCHAR2,
83 rule_id IN INTEGER,
84 extraction_rule IN VARCHAR2
85 );
86 PRAGMA SUPPLEMENTAL_LOG_DATA(add_extract_rule, AUTO);
87
88 /*---------------------------- remove_extract_rule ------------------------*/
89 /*
90 NAME
91 remove_extract_rule
92
93 DESCRIPTION
94 remove a single extraction rule from an extract policy
95
96 ARGUMENT
97 policy_name - the name of the policy
98 rule_id - id for rule to be removed from policy
99 */
100
101 PROCEDURE remove_extract_rule(
102 policy_name IN VARCHAR2,
103 rule_id IN INTEGER
104 );
105 PRAGMA SUPPLEMENTAL_LOG_DATA(remove_extract_rule, AUTO);
106
107 /*---------------------------- add_stop_entity ----------------------------*/
108 /*
109 NAME
110 add_stop_entity
111
112 DESCRIPTION
113 add an entity that is not to be classified - a "stop entity" - to the policy
114
115 ARGUMENT
116 policy_name - policy to associate stop entity with
117 entity_name - entity mention
118 entity_type - entity type
119 comments - comments
120 */
121
122 PROCEDURE add_stop_entity(
123 policy_name IN VARCHAR2,
124 entity_name IN VARCHAR2 DEFAULT NULL,
125 entity_type IN VARCHAR2 DEFAULT NULL,
126 comments IN VARCHAR2 DEFAULT NULL
127 );
128 PRAGMA SUPPLEMENTAL_LOG_DATA(add_stop_entity, AUTO);
129
130 /*---------------------------- remove_stop_entity -------------------------*/
131 /*
132 NAME
133 remove_stop_entity
134
135 DESCRIPTION
136 remove a stop entity from an extract policy
137
138 ARGUMENT
139 policy_name - the name of the policy
140 entity_name - entity mention
141 entity_type - entity type
142 */
143
144 PROCEDURE remove_stop_entity(
145 policy_name IN VARCHAR2,
146 entity_name IN VARCHAR2 DEFAULT NULL,
147 entity_type IN VARCHAR2 DEFAULT NULL
148 );
149 PRAGMA SUPPLEMENTAL_LOG_DATA(remove_stop_entity, AUTO);
150
151 /*---------------------------- compile ------------------------------------*/
152 /*
153 NAME
154 compile
155
156 DESCRIPTION
157 compile added extraction rules and stop-entities into an extract policy
158
159 ARGUMENT
160 policy_name - the name of the policy
161 compile_choice - compile rules, stop-entities, or both
162 locking - locking preferences
163 */
164
165 PROCEDURE compile(
166 policy_name IN VARCHAR2,
167 compile_choice IN NUMBER DEFAULT COMPILE_ALL,
168 locking IN NUMBER DEFAULT LOCK_NOWAIT_ERROR
169 );
170 PRAGMA SUPPLEMENTAL_LOG_DATA(compile, AUTO);
171
172 /*---------------------------- extract -----------------------------*/
173 /*
174 NAME
175 extract
176
177 DESCRIPTION
178 generate character offsets and character lengths of an extracted entity from base document
179
180 ARGUMENT
181 policy_name - the name of the policy
182 document - base document
183 language - name of language in document
184 result - clob containing xml output
185 entity_type_list - entity types that will be extracted (NULL means all types)
186 locking - locking preferences
187
188 */
189
190 PROCEDURE extract(
191 policy_name IN VARCHAR2,
192 document IN CLOB,
193 language IN VARCHAR2,
194 result IN OUT NOCOPY CLOB,
195 entity_type_list IN CLOB DEFAULT NULL,
196 locking IN NUMBER DEFAULT LOCK_NOWAIT_ERROR
197 );
198
199
200 END ctx_entity;