Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

iptc classification java code example

>>> client.set_classifiers(["textrazor_newscodes"])
Comment

iptc classification java code example

>>> response = client.analyze_url("http://www.bbc.co.uk/news/uk-politics-18640916")
Comment

iptc classification java code example

>>> entities = list(response.entities())
>>> entities.sort(key=lambda x: x.relevance_score, reverse=True)
>>> seen = set()
>>> for entity in entities:
>>>     if entity.id not in seen:
>>>         print entity.id, entity.relevance_score, entity.confidence_score, entity.freebase_types
>>>         seen.add(entity.id)

Debt 0.720049 1.53685 ['/media_common/quotation_subject', '/book/book_subject']
Barclays 0.705099 1.77573 []
Bank 0.635486 1.35011 ['/book/book_subject', '/architecture/building_function']
Mervyn King (economist) 0.619704 2.26693 ['/people/person', '/government/politician', '/business/board_member']
Bill (proposed law) 0.619034 1.03724 ['/tv/tv_subject']
Chancellor of the Exchequer 0.607768 0.952038 ['/government/government_office_or_title']
David Cameron 0.5875 4.18796 ['/people/person', '/film/actor', '/government/politician', '/tv/tv_actor', '/film/person_or_entity_appearing_in_film']
Risk 0.563535 0.98141 ['/media_common/quotation_subject', '/book/book_subject']
Citigroup 0.444129 3.39143 ['/business/employer', '/venture_capital/venture_investor', '/business/sponsor', '/award/ranked_item', '/business/issuer', '/business/business_operation', '/organization/organization', '/business/board_member', '/organization/organization_partnership']
Libor 0.436299 2.08194 []
        			
Comment

iptc classification java code example

>>> import textrazor
>>> textrazor.api_key = "API_KEY_GOES_HERE"
>>>
>>> client = textrazor.TextRazor(extractors=["entities", "topics"])
Comment

iptc classification java code example

>>> client.set_cleanup_mode("cleanHTML")
Comment

iptc classification java code example

>>> for topic in response.topics():
>>> 	if topic.score > 0.3:
>>> 		print topic.label

Bank
Libor
Barclays
Politics
Economics
Government
Banking
Business
Bank of England
Financial services
.....
Comment

iptc classification java code example

>>> for category in response.categories():
>>> 	print category.category_id, category.label, category.score

11000000 politics 0.936274
11006000 politics>government 0.899296
11024000 politics>politics (general) 0.856208
04017000 economy, business and finance>economy (general) 0.772154
08003000 human interest>people 0.661979
12006001 religion and belief>values>ethics 0.650902
04018000 economy, business and finance>business (general) 0.650722
14025000 social issue>social issues (general) 0.637389
04006000 economy, business and finance>financial and business service 0.637093
14000000 social issue 0.5628
04006002 economy, business and finance>financial and business service>banking 0.561675
.....
Comment

PREVIOUS NEXT
Code Example
Java :: array srting line by line in textview android 
Java :: java dato numero big starkoverflow 
Java :: how apache shiro remember me works 
Java :: devoluciones redsys api 
Java :: java manipulate alphabet list 
Sql :: sql developer search all packages for text 
Sql :: codeigniter print last sql query 
Sql :: find sp name by text in sql server 
Sql :: postgresql stop all connections 
Sql :: cannot truncate a table referenced in a foreign key constraint 
Sql :: oracle sql drop sequence 
Sql :: Failed to stop mysqld.service: Unit mysqld.service not loaded. 
Sql :: list all indexes postgres 
Sql :: oracle get current schema 
Sql :: select duplicates in sql 
Sql :: too many connections mysql 
Sql :: create table in postgresql 
Sql :: check current sequence value postgres 
Sql :: import sql file from laravel 
Sql :: oracle list packages 
Sql :: mysql get last row 
Sql :: import sql mysql ubuntu 
Sql :: sql server get timezone 
Sql :: create table sql server 
Sql :: oracle drop column 
Sql :: sql padd let with zeros 
Sql :: how to get current mysql version 
Sql :: check all sequences oracle sql 
Sql :: how to check database engine in mysql 
Sql :: sql getdate minus 1 day without time 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =