-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
55 lines (45 loc) · 1.85 KB
/
config.py
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
import os
from events import spellchecker
blockchain_blacklist_tokens = frozenset([
'ethereum', 'blockchain', 'bitcoin', 'ico', 'ledger',
'crypto', 'cryptocurrency', 'money', 'gold', 'token'])
business_blacklist_tokens = frozenset([
'business', 'enterprise', 'entrepreneur', 'entrepreneurship',
'executive', 'founder', 'investor', 'skillsfuture'])
# Minimum number of tokens to blacklist a group or event in each topic [blockchain, bussines]
token_thresholds = [1, 5]
meetup = {
'groups_url': 'https://api.meetup.com/find/groups',
'events_url': 'https://api.meetup.com/2/events',
'max_event_hours': 12,
'max_meetup_responses': 150,
'display_time_format': '%d-%b, %a, %I:%M %p',
'params': {
'key': os.environ['MEETUP_API_KEY'],
'country': 'SG',
'location': 'Singapore',
'category': 34,
'fields': 'topics'
}
}
########################
# auto-enhancements to the blacklist tokens.
# Enhance the blacklist tokens by expanding the set with possible typos
enhanced_blockchain_blacklist_tokens = set()
for token in blockchain_blacklist_tokens:
if len(token) < 6:
enhanced_blockchain_blacklist_tokens.add(token)
else:
enhanced_blockchain_blacklist_tokens = enhanced_blockchain_blacklist_tokens.union(
spellchecker.typos(token))
enhanced_business_blacklist_tokens = set()
for token in business_blacklist_tokens:
enhanced_business_blacklist_tokens = enhanced_business_blacklist_tokens.union(
spellchecker.typos(token))
multi_enhanced_blacklist_tokens = [
enhanced_blockchain_blacklist_tokens,
enhanced_business_blacklist_tokens
]
blacklist_tokens = frozenset(list(blockchain_blacklist_tokens) + list(business_blacklist_tokens))
print('{} blacklist tokens'.format(
len(enhanced_blockchain_blacklist_tokens) + len(enhanced_business_blacklist_tokens)))