Skip to content

Commit 62c4f9a

Browse files
Add files via upload
1 parent 4aa6e6a commit 62c4f9a

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

Diff for: minor.pdf

733 KB
Binary file not shown.

Diff for: utf-8''genism.ipynb

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"cells": [
3+
{
4+
"metadata": {
5+
"trusted": true
6+
},
7+
"cell_type": "code",
8+
"source": "import gensim \nprint('gensim Version: %s' % (gensim.__version__))",
9+
"execution_count": 1,
10+
"outputs": [
11+
{
12+
"output_type": "stream",
13+
"text": "gensim Version: 3.8.0\n",
14+
"name": "stdout"
15+
}
16+
]
17+
},
18+
{
19+
"metadata": {
20+
"trusted": true
21+
},
22+
"cell_type": "code",
23+
"source": "# sample data \n\ncontent = \"Microsoft held talks in the past few weeks \" + \\\n \"to acquire software developer platform GitHub, Business \" + \\\n \"Insider reports. One person familiar with the discussions \" + \\\n \"between the companies told CNBC that they had been \" + \\\n \"considering a joint marketing partnership valued around \" + \\\n \"$35 million, and that those discussions had progressed to \" + \\\n \"a possible investment or outright acquisition. It is \" + \\\n \"unclear whether talks are still ongoing, but this \" + \\\n \"person said that GitHub's price for a full acquisition \" + \\\n \"was more than Microsoft currently wanted to pay. GitHub \" + \\\n \"was last valued at $2 billion in its last funding round \" + \\\n \"2015, but the price tag for an acquisition could be $5 \" + \\\n \"billion or more, based on a price that was floated \" + \\\n \"last year. GitHub's tools have become essential to \" + \\\n \"software developers, who use it to store code, \" + \\\n \"keep track of updates and discuss issues. The privately \" + \\\n \"held company has more than 23 million individual users in \" + \\\n \"more than 1.5 million organizations. It was on track to \" + \\\n \"book more than $200 million in subscription revenue, \" + \\\n \"including more than $110 million from companies using its \" + \\\n \"enterprise product, GitHub told CNBC last fall.Microsoft \" + \\\n \"has reportedly flirted with buying GitHub in the past, \" + \\\n \"including in 2016, although GitHub denied those \" + \\\n \"reports. A partnership would give Microsoft another \" + \\\n \"connection point to the developers it needs to court to \" + \\\n \"build applications on its various platforms, including \" + \\\n \"the Azure cloud. Microsoft could also use data from \" + \\\n \"GitHub to improve its artificial intelligence \" + \\\n \"producs. The talks come amid GitHub's struggle to \" + \\\n \"replace CEO and founder Chris Wanstrath, who stepped \" + \\\n \"down 10 months ago. Business Insider reported that \" + \\\n \"Microsoft exec Nat Friedman -- who previously \" + \\\n \"ran Xamarin, a developer tools start-up that Microsoft \" + \\\n \"acquired in 2016 -- may take that CEO role. Google's \" + \\\n \"senior VP of ads and commerce, Sridhar Ramaswamy, has \" + \\\n \"also been in discussions for the job, says the report. \" + \\\n \"Microsoft declined to comment on the report. \" + \\\n \"GitHub did not immediately return a request for comment.\"",
24+
"execution_count": 2,
25+
"outputs": []
26+
},
27+
{
28+
"metadata": {
29+
"trusted": true
30+
},
31+
"cell_type": "code",
32+
"source": "# summarizing with respect to ration of the content \nprint('Original Content:')\nprint(content)\nfor ratio in [0.3, 0.5, 0.7]:\n summarized_content = gensim.summarization.summarize(content, ratio=ratio)\n print()\n print('----> Summarized Content (Ratio is %.01f):' % ratio)\n print(summarized_content)",
33+
"execution_count": 3,
34+
"outputs": [
35+
{
36+
"output_type": "stream",
37+
"text": "Original Content:\nMicrosoft held talks in the past few weeks to acquire software developer platform GitHub, Business Insider reports. One person familiar with the discussions between the companies told CNBC that they had been considering a joint marketing partnership valued around $35 million, and that those discussions had progressed to a possible investment or outright acquisition. It is unclear whether talks are still ongoing, but this person said that GitHub's price for a full acquisition was more than Microsoft currently wanted to pay. GitHub was last valued at $2 billion in its last funding round 2015, but the price tag for an acquisition could be $5 billion or more, based on a price that was floated last year. GitHub's tools have become essential to software developers, who use it to store code, keep track of updates and discuss issues. The privately held company has more than 23 million individual users in more than 1.5 million organizations. It was on track to book more than $200 million in subscription revenue, including more than $110 million from companies using its enterprise product, GitHub told CNBC last fall.Microsoft has reportedly flirted with buying GitHub in the past, including in 2016, although GitHub denied those reports. A partnership would give Microsoft another connection point to the developers it needs to court to build applications on its various platforms, including the Azure cloud. Microsoft could also use data from GitHub to improve its artificial intelligence producs. The talks come amid GitHub's struggle to replace CEO and founder Chris Wanstrath, who stepped down 10 months ago. Business Insider reported that Microsoft exec Nat Friedman -- who previously ran Xamarin, a developer tools start-up that Microsoft acquired in 2016 -- may take that CEO role. Google's senior VP of ads and commerce, Sridhar Ramaswamy, has also been in discussions for the job, says the report. Microsoft declined to comment on the report. GitHub did not immediately return a request for comment.\n\n---> Summarized Content (Ratio is 0.3):\nMicrosoft held talks in the past few weeks to acquire software developer platform GitHub, Business Insider reports.\nOne person familiar with the discussions between the companies told CNBC that they had been considering a joint marketing partnership valued around $35 million, and that those discussions had progressed to a possible investment or outright acquisition.\nIt was on track to book more than $200 million in subscription revenue, including more than $110 million from companies using its enterprise product, GitHub told CNBC last fall.Microsoft has reportedly flirted with buying GitHub in the past, including in 2016, although GitHub denied those reports.\nBusiness Insider reported that Microsoft exec Nat Friedman -- who previously ran Xamarin, a developer tools start-up that Microsoft acquired in 2016 -- may take that CEO role.\n\n---> Summarized Content (Ratio is 0.5):\nMicrosoft held talks in the past few weeks to acquire software developer platform GitHub, Business Insider reports.\nOne person familiar with the discussions between the companies told CNBC that they had been considering a joint marketing partnership valued around $35 million, and that those discussions had progressed to a possible investment or outright acquisition.\nIt is unclear whether talks are still ongoing, but this person said that GitHub's price for a full acquisition was more than Microsoft currently wanted to pay.\nGitHub's tools have become essential to software developers, who use it to store code, keep track of updates and discuss issues.\nIt was on track to book more than $200 million in subscription revenue, including more than $110 million from companies using its enterprise product, GitHub told CNBC last fall.Microsoft has reportedly flirted with buying GitHub in the past, including in 2016, although GitHub denied those reports.\nBusiness Insider reported that Microsoft exec Nat Friedman -- who previously ran Xamarin, a developer tools start-up that Microsoft acquired in 2016 -- may take that CEO role.\nMicrosoft declined to comment on the report.\n\n---> Summarized Content (Ratio is 0.7):\nMicrosoft held talks in the past few weeks to acquire software developer platform GitHub, Business Insider reports.\nOne person familiar with the discussions between the companies told CNBC that they had been considering a joint marketing partnership valued around $35 million, and that those discussions had progressed to a possible investment or outright acquisition.\nIt is unclear whether talks are still ongoing, but this person said that GitHub's price for a full acquisition was more than Microsoft currently wanted to pay.\nGitHub's tools have become essential to software developers, who use it to store code, keep track of updates and discuss issues.\nThe privately held company has more than 23 million individual users in more than 1.5 million organizations.\nIt was on track to book more than $200 million in subscription revenue, including more than $110 million from companies using its enterprise product, GitHub told CNBC last fall.Microsoft has reportedly flirted with buying GitHub in the past, including in 2016, although GitHub denied those reports.\nA partnership would give Microsoft another connection point to the developers it needs to court to build applications on its various platforms, including the Azure cloud.\nBusiness Insider reported that Microsoft exec Nat Friedman -- who previously ran Xamarin, a developer tools start-up that Microsoft acquired in 2016 -- may take that CEO role.\nMicrosoft declined to comment on the report.\n",
38+
"name": "stdout"
39+
}
40+
]
41+
},
42+
{
43+
"metadata": {
44+
"trusted": true
45+
},
46+
"cell_type": "code",
47+
"source": "#sumarizing with the no of total words in summary \nprint('Original Content:')\nprint(content)\nfor word_count in [30, 50, 100]:\n summarized_content = gensim.summarization.summarize(content, word_count=word_count)\n print()\n print('---> Summarized Content (Word Count is %d):' % word_count)\n print(summarized_content)",
48+
"execution_count": 4,
49+
"outputs": [
50+
{
51+
"output_type": "stream",
52+
"text": "Original Content:\nMicrosoft held talks in the past few weeks to acquire software developer platform GitHub, Business Insider reports. One person familiar with the discussions between the companies told CNBC that they had been considering a joint marketing partnership valued around $35 million, and that those discussions had progressed to a possible investment or outright acquisition. It is unclear whether talks are still ongoing, but this person said that GitHub's price for a full acquisition was more than Microsoft currently wanted to pay. GitHub was last valued at $2 billion in its last funding round 2015, but the price tag for an acquisition could be $5 billion or more, based on a price that was floated last year. GitHub's tools have become essential to software developers, who use it to store code, keep track of updates and discuss issues. The privately held company has more than 23 million individual users in more than 1.5 million organizations. It was on track to book more than $200 million in subscription revenue, including more than $110 million from companies using its enterprise product, GitHub told CNBC last fall.Microsoft has reportedly flirted with buying GitHub in the past, including in 2016, although GitHub denied those reports. A partnership would give Microsoft another connection point to the developers it needs to court to build applications on its various platforms, including the Azure cloud. Microsoft could also use data from GitHub to improve its artificial intelligence producs. The talks come amid GitHub's struggle to replace CEO and founder Chris Wanstrath, who stepped down 10 months ago. Business Insider reported that Microsoft exec Nat Friedman -- who previously ran Xamarin, a developer tools start-up that Microsoft acquired in 2016 -- may take that CEO role. Google's senior VP of ads and commerce, Sridhar Ramaswamy, has also been in discussions for the job, says the report. Microsoft declined to comment on the report. GitHub did not immediately return a request for comment.\n\n---> Summarized Content (Word Count is 30):\nMicrosoft held talks in the past few weeks to acquire software developer platform GitHub, Business Insider reports.\n\n---> Summarized Content (Word Count is 50):\nMicrosoft held talks in the past few weeks to acquire software developer platform GitHub, Business Insider reports.\nOne person familiar with the discussions between the companies told CNBC that they had been considering a joint marketing partnership valued around $35 million, and that those discussions had progressed to a possible investment or outright acquisition.\n\n---> Summarized Content (Word Count is 100):\nMicrosoft held talks in the past few weeks to acquire software developer platform GitHub, Business Insider reports.\nOne person familiar with the discussions between the companies told CNBC that they had been considering a joint marketing partnership valued around $35 million, and that those discussions had progressed to a possible investment or outright acquisition.\nIt was on track to book more than $200 million in subscription revenue, including more than $110 million from companies using its enterprise product, GitHub told CNBC last fall.Microsoft has reportedly flirted with buying GitHub in the past, including in 2016, although GitHub denied those reports.\n",
53+
"name": "stdout"
54+
}
55+
]
56+
},
57+
{
58+
"metadata": {
59+
"trusted": true
60+
},
61+
"cell_type": "code",
62+
"source": "",
63+
"execution_count": null,
64+
"outputs": []
65+
}
66+
],
67+
"metadata": {
68+
"kernelspec": {
69+
"name": "python36",
70+
"display_name": "Python 3.6",
71+
"language": "python"
72+
},
73+
"language_info": {
74+
"mimetype": "text/x-python",
75+
"nbconvert_exporter": "python",
76+
"name": "python",
77+
"pygments_lexer": "ipython3",
78+
"version": "3.6.6",
79+
"file_extension": ".py",
80+
"codemirror_mode": {
81+
"version": 3,
82+
"name": "ipython"
83+
}
84+
}
85+
},
86+
"nbformat": 4,
87+
"nbformat_minor": 2
88+
}

Diff for: utf-8''minor.ipynb

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"cells": [
3+
{
4+
"metadata": {
5+
"trusted": true
6+
},
7+
"cell_type": "code",
8+
"source": "from gensim.summarization.summarizer import summarize\n>>> text = '''The desire for more positive experience is itself a negative experience. And, paradoxically, the acceptance of one’s negative experience is itself a positive experience.\n\nThe more you pursue feeling better all the time, the less satisfied you become, as pursuing something only reinforces the fact that you lack it in the first place. Philosopher Alan Watts used to refer to as “The Backwards Law” (further reading: the hedonic treadmill).\n\nEverything worthwhile in life is won through surmounting the associated negative experience.\n\nPain and loss are inevitable and we should let go of trying to resist them.\n\nThe greatest truths in life are usually the most unpleasant to hear.\n\nWe suffer for the simple reason that suffering is biologically useful. It is nature’s preferred agent for inspiring change.\n\nDon’t hope for a life without problems. There’s no such thing. Instead, hope for a life full of good problems.\n\nProblems never stop; they merely get exchanged and/or upgraded.\n\nHappiness comes from problems you enjoy having and solving.\n\nNobody who is actually happy has to stand in front of a mirror and tell himself that he’s happy.\n\nEmotions are simply biological signals designed to nudge you in the direction of beneficial change.'''\n>>> print(summarize(text))",
9+
"execution_count": 1,
10+
"outputs": [
11+
{
12+
"output_type": "stream",
13+
"text": "Don’t hope for a life without problems.\nInstead, hope for a life full of good problems.\nEmotions are simply biological signals designed to nudge you in the direction of beneficial change.\n",
14+
"name": "stdout"
15+
}
16+
]
17+
},
18+
{
19+
"metadata": {
20+
"trusted": true
21+
},
22+
"cell_type": "code",
23+
"source": "",
24+
"execution_count": null,
25+
"outputs": []
26+
}
27+
],
28+
"metadata": {
29+
"kernelspec": {
30+
"name": "python36",
31+
"display_name": "Python 3.6",
32+
"language": "python"
33+
},
34+
"language_info": {
35+
"mimetype": "text/x-python",
36+
"nbconvert_exporter": "python",
37+
"name": "python",
38+
"pygments_lexer": "ipython3",
39+
"version": "3.6.6",
40+
"file_extension": ".py",
41+
"codemirror_mode": {
42+
"version": 3,
43+
"name": "ipython"
44+
}
45+
}
46+
},
47+
"nbformat": 4,
48+
"nbformat_minor": 2
49+
}

0 commit comments

Comments
 (0)