#!/usr/bin/env python
# -*- coding: utf-8 -*-

import S3
import os
import word_embeddings
import click

references = [["The thinning of glaciers and ice shelves, as well as the softening of the permafrost, has accelerated greatly in recent years.\
While it is not certain that the man-made greenhouse effect is entirely to blame, it is clear that man must take steps now to address the problem.\
Global warming affects everything: oil-platforms, the society of peoples who are indiginous to the polar regions, polar animals, migratory birds, lakes (which are drying up as the permafrost melts), and even tourism.\
As melting cold fresh water enters the salty sea, it will affect ocean currents and therefore world climate."],
			  ["In Antarctica and the Artic, ice melts are causing complex questions about the impact of global warming.\
In Antarctica huge glaciers are thinning and ice shelves are either disintegrating or retreating.\
These findings are possible indications of global warming.\
Information gathered about Antarctica coincides with a recent report on accelerating climate changes in the Arctic.\
A Chinese scientist predicted that the Artic icecap would melt by 2080.\
The Arctic's indigenous people (about 4 million) are fighting global warming because it will be a threat to their societies, economies and culture."],
			  ["Collapse of coastal Antarctic ice shelves accelerated eight-fold the seaward flow of inland glaciers, raising sea levels: Larsen A (1995), Wilkins (1998), Larsen B (2002), Larsen C (this century).\
Currents undermine the Ross and Ronne ice shelves, enabling ice flows from deep within the West Antarctic ice sheet.\
Arctic permafrost thawed; glaciers and sea ice retreated.\
In 30 years the Arctic ice cap's area shrank by 10%, its thickness by 42%, opening shorter maritime routes when Arctic sea ice disappears in future summers.\
Siberian lakes disappeared.\
Indigenous cultures and glacier tourism suffered.\
Bird migrations shifted.\
Northern Hemisphere weather will worsen."],
			  ["Ice continues to melt at an alarming rate in both the Arctic and Antarctic.\
Higher temperatures have shrunk the Arctic ice area 10% and its thickness 42% in 30 years.\
The permafrost is shrinking, endangering infrastructure.\
These changes are threatening the culture and economy of the indigenous Artic population.\
Ice shelves in the Antarctic are collapsing.\
The melting of the West Antarctic Ice Sheet could raise ocean levels worldwide approximately 15 feet.\
Increased tourism in the Antarctic is having an environmental impact.\
Researchers are debating whether greenhouse gases or natural climate cycles are the biggest cause of the melting."]]

system_summary = ["Interior Alaska's permafrost has warmed in some places to the highest level since the ice age ended 10,000 years ago, its temperature now within a degree or two of thawing.\
  Earth frozen since woolly mammoths and bison wandered Interior steppes has been turning to mush. Lakes have been shrinking. Trees are stressed. Prehistoric ice has melted underground, leaving voids that collapse into sinkholes. \
 Largely concentrated where people have disturbed the surface, such damage can be expensive, even heartbreaking. It's happening now in Fairbanks: Toppled spruce, roller-coaster bike trails, rippled pavement, homes and buildings that sag into ruin."]

@click.command()
@click.argument('embs_path', type=click.Path(exists=True))
@click.argument('model_folder', type=click.Path(exists=True))
def run_example(embs_path, model_folder):
	word_embs = word_embeddings.load_embeddings(embs_path)
	result = S3.S3(references, system_summary, word_embs, model_folder)
	print "RESULTS: "
	print "-- (trained on normalized pyramid): ", result[0]
	print "-- (trained on normalized responsiveness): ", result[1]

if __name__ == '__main__':
	run_example()
	
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import S3
import os
import word_embeddings
import click

references = [["The thinning of glaciers and ice shelves, as well as the softening of the permafrost, has accelerated greatly in recent years.\
While it is not certain that the man-made greenhouse effect is entirely to blame, it is clear that man must take steps now to address the problem.\
Global warming affects everything: oil-platforms, the society of peoples who are indiginous to the polar regions, polar animals, migratory birds, lakes (which are drying up as the permafrost melts), and even tourism.\
As melting cold fresh water enters the salty sea, it will affect ocean currents and therefore world climate."],
			  ["In Antarctica and the Artic, ice melts are causing complex questions about the impact of global warming.\
In Antarctica huge glaciers are thinning and ice shelves are either disintegrating or retreating.\
These findings are possible indications of global warming.\
Information gathered about Antarctica coincides with a recent report on accelerating climate changes in the Arctic.\
A Chinese scientist predicted that the Artic icecap would melt by 2080.\
The Arctic's indigenous people (about 4 million) are fighting global warming because it will be a threat to their societies, economies and culture."],
			  ["Collapse of coastal Antarctic ice shelves accelerated eight-fold the seaward flow of inland glaciers, raising sea levels: Larsen A (1995), Wilkins (1998), Larsen B (2002), Larsen C (this century).\
Currents undermine the Ross and Ronne ice shelves, enabling ice flows from deep within the West Antarctic ice sheet.\
Arctic permafrost thawed; glaciers and sea ice retreated.\
In 30 years the Arctic ice cap's area shrank by 10%, its thickness by 42%, opening shorter maritime routes when Arctic sea ice disappears in future summers.\
Siberian lakes disappeared.\
Indigenous cultures and glacier tourism suffered.\
Bird migrations shifted.\
Northern Hemisphere weather will worsen."],
			  ["Ice continues to melt at an alarming rate in both the Arctic and Antarctic.\
Higher temperatures have shrunk the Arctic ice area 10% and its thickness 42% in 30 years.\
The permafrost is shrinking, endangering infrastructure.\
These changes are threatening the culture and economy of the indigenous Artic population.\
Ice shelves in the Antarctic are collapsing.\
The melting of the West Antarctic Ice Sheet could raise ocean levels worldwide approximately 15 feet.\
Increased tourism in the Antarctic is having an environmental impact.\
Researchers are debating whether greenhouse gases or natural climate cycles are the biggest cause of the melting."]]

system_summary = ["Interior Alaska's permafrost has warmed in some places to the highest level since the ice age ended 10,000 years ago, its temperature now within a degree or two of thawing.\
  Earth frozen since woolly mammoths and bison wandered Interior steppes has been turning to mush. Lakes have been shrinking. Trees are stressed. Prehistoric ice has melted underground, leaving voids that collapse into sinkholes. \
 Largely concentrated where people have disturbed the surface, such damage can be expensive, even heartbreaking. It's happening now in Fairbanks: Toppled spruce, roller-coaster bike trails, rippled pavement, homes and buildings that sag into ruin."]

@click.command()
@click.argument('embs_path', type=click.Path(exists=True))
@click.argument('model_folder', type=click.Path(exists=True))
def run_example(embs_path, model_folder):
	word_embs = word_embeddings.load_embeddings(embs_path)
	result = S3.S3(references, system_summary, word_embs, model_folder)
	print "RESULTS: "
	print "-- (trained on normalized pyramid): ", result[0]
	print "-- (trained on normalized responsiveness): ", result[1]

if __name__ == '__main__':
	run_example()
	
#!/usr/bin/env python # -*- coding: utf-8 -*-