├── .coveragerc ├── .gitignore ├── .version ├── Dockerfile ├── LICENSE ├── README.md ├── app.py ├── docs ├── .buildinfo ├── genindex.html ├── images │ └── graph_run=.png ├── index.html ├── modules │ ├── index.html │ ├── sentence_handler.html │ └── wrappers │ │ ├── spacy_wrapper.html │ │ └── tensorflow_wrapper.html ├── objects.inv ├── py-modindex.html ├── search.html ├── searchindex.js ├── sentencehandler.html ├── spacywrapper.html ├── static │ ├── alabaster.css │ ├── basic.css │ ├── custom.css │ ├── doctools.js │ ├── documentation_options.js │ ├── file.png │ ├── jquery-3.4.1.js │ ├── jquery.js │ ├── language_data.js │ ├── minus.png │ ├── plus.png │ ├── pygments.css │ ├── searchtools.js │ ├── underscore-1.3.1.js │ └── underscore.js └── tensorflowwrapper.html ├── images └── graph_run=.png ├── properties.yaml ├── requirements-dev.txt ├── requirements.txt ├── sentence_handler.py ├── tests ├── __init__.py ├── test_sentence_handler.py └── wrappers │ ├── __init__.py │ ├── test_spacy_wrapper.py │ └── test_tensorflow_wrapper.py ├── tox.ini └── wrappers ├── __init__.py ├── spacy_wrapper.py └── tensorflow_wrapper.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [report] 2 | omit = 3 | */python?.?/* 4 | */site-packages/nose/* 5 | *__init__* 6 | *tests/* 7 | */.tox/* 8 | */setup.py 9 | app.py 10 | [run] 11 | parallel=True 12 | concurrency=multiprocessing -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | *.so 6 | .Python 7 | build/ 8 | develop-eggs/ 9 | dist/ 10 | downloads/ 11 | eggs/ 12 | .eggs/ 13 | lib/ 14 | lib64/ 15 | parts/ 16 | sdist/ 17 | var/ 18 | wheels/ 19 | pip-wheel-metadata/ 20 | share/python-wheels/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | MANIFEST 25 | *.manifest 26 | *.spec 27 | pip-log.txt 28 | pip-delete-this-directory.txt 29 | htmlcov/ 30 | .tox/ 31 | .nox/ 32 | .coverage 33 | .coverage.* 34 | .cache 35 | nosetests.xml 36 | coverage.xml 37 | *.cover 38 | .hypothesis/ 39 | .pytest_cache/ 40 | *.mo 41 | *.pot 42 | *.log 43 | local_settings.py 44 | db.sqlite3 45 | instance/ 46 | .webassets-cache 47 | .scrapy 48 | docs/_build/ 49 | target/ 50 | .ipynb_checkpoints 51 | profile_default/ 52 | ipython_config.py 53 | .python-version 54 | celerybeat-schedule 55 | *.sage.py 56 | .env 57 | .venv 58 | env/ 59 | venv/ 60 | ENV/ 61 | env.bak/ 62 | venv.bak/ 63 | .spyderproject 64 | .spyproject 65 | .ropeproject 66 | /site 67 | .mypy_cache/ 68 | .dmypy.json 69 | dmypy.json 70 | .pyre/ 71 | .idea/ 72 | cmake-build-*/ 73 | *.iws 74 | out/ 75 | .idea_modules/ 76 | atlassian-ide-plugin.xml 77 | com_crashlytics_export_strings.xml 78 | crashlytics.properties 79 | crashlytics-build.properties 80 | fabric.properties 81 | /text-summarization.iml 82 | /sphinx-doc/* 83 | -------------------------------------------------------------------------------- /.version: -------------------------------------------------------------------------------- 1 | version==1.0 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.7 2 | COPY wrappers /app/wrappers 3 | COPY app.py /app 4 | COPY properties.yaml /app 5 | COPY requirements.txt /app 6 | COPY sentence_handler.py /app 7 | WORKDIR /app 8 | RUN pip install -r requirements.txt 9 | RUN python -m spacy download en_core_web_sm 10 | EXPOSE 8080 11 | CMD python ./app.py -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Idan Morad 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auto Text Summarization 2 | 3 | [full code documentation](https://idanmoradarthas.github.io/text-summarization/) 4 | 5 | ``` 6 | Automatic summarization is the process of shortening a text document with software, in order to create a summary 7 | with the major points of the original document. 8 | ``` 9 | --Wikipedia 10 | 11 | This project was inspired by work of Praveen Dubey in 12 | [Understand Text Summarization and create your own summarizer in python](https://towardsdatascience.com/understand-text-summarization-and-create-your-own-summarizer-in-python-b26a9f09fc70). 13 | 14 | The summarization uses the Universal Sentence Encoder[1] with the deep learning framework of TensorFlow, SpaCy for 15 | linguistic and NetworkX for ranking. The project itself is a RestAPI script build with Flask framework. 16 | 17 | The algorithm steps are as follows: 18 | 1. Read the given text and splitting it into sentences using SpaCy. 19 | 2. Generate sentences pairs cosine similarity score based on their dimensional vectors with TensorFlow graph and the 20 | Universal Sentence Encoder as an embedding layer (see network architecture picture below). 21 | 3. Generate similarity matrix across the sentences and rank them using NetworkX implementation of PageRank. 22 | 4. Sort the rank sentences and pick the top ones according the user's input. 23 | 24 | ## TensorFlow graph with the Universal Sentence Encoder 25 | ![Graph](images/graph_run=.png) 26 | 27 | ## Install and run project 28 | build with ```python==3.7.3``` and ```tox==3.12.0```. 29 | 30 | ``` 31 | git clone https://github.com/idanmoradarthas/text-summarization.git 32 | cd text-summarization 33 | pip install -r requirements.txt 34 | python app.py 35 | ``` 36 | 37 | the app will run on 0.0.0.0:8080 38 | 39 | ## Interface v1.0 40 | ### Request and Response 41 | Request Should be constructed as such and send in method POST: 42 | ```json 43 | { 44 | "doc": text, 45 | "summarized sentences length": number of sentences that will comprised the summary 46 | } 47 | ``` 48 | where each document will be in separate brackets. 49 | 50 | The API is exposed in route "/summarize/v1.0". so the full address should be ```:8080/classify/v1.0``` 51 | 52 | For example: 53 | 54 | For the following text: 55 | ``` 56 | In an attempt to build an AI-ready workforce, Microsoft announced Intelligent Cloud Hub which has been launched to 57 | empower the next generation of students with AI-ready skills. Envisioned as a three-year collaborative program, 58 | Intelligent Cloud Hub will support around 100 institutions with AI infrastructure, course content and curriculum, 59 | developer support, development tools and give students access to cloud and AI services. As part of the program, the 60 | Redmond giant which wants to expand its reach and is planning to build a strong developer ecosystem in India 61 | with the program will set up the core AI infrastructure and IoT Hub for the selected campuses. The company will 62 | provide AI development tools and Azure AI services such as Microsoft Cognitive Services, Bot Services and Azure 63 | Machine Learning. According to Manish Prakash, Country General Manager-PS, Health and Education, Microsoft India, 64 | said, "With AI being the defining technology of our time, it is transforming lives and industry and the jobs of 65 | tomorrow will require a different skillset. This will require more collaborations and training and working with AI. 66 | That’s why it has become more critical than ever for educational institutions to integrate new cloud and AI 67 | technologies. The program is an attempt to ramp up the institutional set-up and build capabilities among the 68 | educators to educate the workforce of tomorrow." The program aims to build up the cognitive skills and in-depth 69 | understanding of developing intelligent cloud connected solutions for applications across industry. Earlier in 70 | April this year, the company announced Microsoft Professional Program In AI as a learning track open to the public. 71 | The program was developed to provide job ready skills to programmers who wanted to hone their skills in AI and data 72 | science with a series of online courses which featured hands-on labs and expert instructors as well. This program 73 | also included developer-focused AI school that provided a bunch of assets to help build AI skills. 74 | ``` 75 | (source: [analyticsindiamag.com](https://www.analyticsindiamag.com/microsoft-launches-intelligent-cloud-hub-to-upskill-students-in-ai-cloud-technologies/)) 76 | 77 | we will give the following request (replace with the text above) 78 | ```json 79 | { 80 | "doc": "", 81 | "summarized sentences length": 3 82 | } 83 | ``` 84 | 85 | The response will be 86 | ```json 87 | { 88 | "summarized text": "summarized text" 89 | } 90 | ``` 91 | 92 | For example: 93 | 94 | The returned summarized text from the above request will be: 95 | ``` 96 | In an attempt to build an AI-ready workforce, Microsoft announced Intelligent Cloud Hub which has been launched to 97 | empower the next generation of students with AI-ready skills. The company will provide AI development tools and 98 | Azure AI services such as Microsoft Cognitive Services, Bot Services and Azure Machine Learning. The program 99 | was developed to provide job ready skills to programmers who wanted to hone their skills in AI and data science 100 | with a series of online courses which featured hands-on labs and expert instructors as well. 101 | ``` 102 | 103 | ## References 104 | [1] Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St. John, Noah Constant, Mario 105 | Guajardo-Céspedes, Steve Yuan, Chris Tar, Yun-Hsuan Sung, Brian Strope, Ray Kurzweil. 106 | [Universal Sentence Encoder](https://arxiv.org/abs/1803.11175). arXiv:1803.11175, 2018. -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import yaml 4 | from flask import Flask, request, Response, jsonify 5 | 6 | from sentence_handler import sentence_pairing, sentence_rank_with_page_rank, sentence_sorter 7 | from wrappers.spacy_wrapper import SpacyWrapper 8 | from wrappers.tensorflow_wrapper import TensorFlowWrapper 9 | 10 | app = Flask(__name__) 11 | 12 | with open(Path(__file__).parent.joinpath("properties.yaml"), "r") as f: 13 | properties = yaml.safe_load(f) 14 | 15 | spacy_wrapper = SpacyWrapper(properties["spacy-module"]) 16 | tensorflow_wrapper = TensorFlowWrapper(properties["universal-sentence-encoder-model"]) 17 | 18 | 19 | @app.route("/summarize/v1.0", methods=["POST"]) 20 | def summarize(): 21 | if request.headers['Content-Type'] != 'application/json': 22 | return Response(status=400) 23 | document = request.json["doc"] 24 | sentences = spacy_wrapper.sentence_tokenizer(document) 25 | df = sentence_pairing(sentences) 26 | tensorflow_wrapper.append_scores(df) 27 | result = sentence_rank_with_page_rank(df) 28 | answer = {"summarized text": sentence_sorter(result, request.json["summarized sentences length"], sentences)} 29 | resp = jsonify(answer) 30 | resp.status_code = 200 31 | return resp 32 | 33 | 34 | if __name__ == '__main__': 35 | app.run(port=8080, host="0.0.0.0") 36 | -------------------------------------------------------------------------------- /docs/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: f92c3b3fdf472240048d4536faed7bdd 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Index — text-summarization 1.0 documentation 7 | 8 | 9 | 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 |

Index

36 | 37 |
38 | A 39 | | C 40 | | S 41 | | T 42 | 43 |
44 |

A

45 | 46 | 47 | 55 | 56 |
48 | 54 |
57 | 58 |

C

59 | 60 | 61 | 69 | 70 |
62 | 68 |
71 | 72 |

S

73 | 74 | 75 | 87 | 100 | 101 |
76 | 86 | 88 | 99 |
102 | 103 |

T

104 | 105 | 106 | 113 | 114 |
107 | 112 |
115 | 116 | 117 |
118 | 119 |
120 |
121 | 159 |
160 |
161 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /docs/images/graph_run=.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idanmoradarthas/text-summarization/921252f9c135d77a1441d4de8c255f6a56c5331d/docs/images/graph_run=.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Welcome to text-summarization’s documentation! — text-summarization 1.0 documentation 8 | 9 | 10 | 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 |

Welcome to text-summarization’s documentation!

40 |
41 |

Contents:

42 | 50 |
51 |
52 |

Introduction

54 |

This project is an auto text summarization build in python with Spacy and Universal Sentence 55 | Encoder on Flask framework.

56 |

Automatic summarization is the process of shortening a text document with software, in 57 | order to create a summary 58 | with the major points of the original document. -Wikipedia

59 |

This project was inspired by work of Praveen Dubey in 60 | Understand 62 | Text Summarization and create your own summarizer in python.

63 |

The summarization uses the Universal Sentence Encoder[1] with the deep learning framework of 64 | TensorFlow, SpaCy for 65 | linguistic and NetworkX for ranking. The project itself is a RestAPI script build with Flask 66 | framework.

67 |

The algorithm steps are as follows:

68 |
    69 |
  1. Read the given text and splitting it into sentences using SpaCy.

  2. 70 |
  3. Generate sentences pairs cosine similarity score based on their dimensional vectors 71 | with TensorFlow graph and the Universal Sentence Encoder as an embedding layer (see 72 | network architecture picture below).

  4. 73 |
  5. Generate similarity matrix across the sentences and rank them using NetworkX 74 | implementation of PageRank.

  6. 75 |
  7. Sort the rank sentences and pick the top ones according the user’s input.

  8. 76 |
77 |
78 |

TensorFlow graph with the Universal Sentence Encoder 81 |

82 |
83 | _images/graph_run=.png 84 |
85 |
86 |
87 |

References

89 |

[1] Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St. John, 90 | Noah Constant, Mario 91 | Guajardo-Céspedes, Steve Yuan, Chris Tar, Yun-Hsuan Sung, Brian Strope, Ray Kurzweil. 92 | Universal Sentence 93 | Encoder. arXiv:1803.11175, 2018.

94 |
95 |
96 |
97 |
98 |

Indices and tables

100 | 108 |

←back 109 | to github

110 |
111 | 112 | 113 |
114 | 115 |
116 |
117 | 156 |
157 |
158 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /docs/modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview: module code — text-summarization 1.0 documentation 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 | 32 | 33 |
34 | 35 |

All modules for which code is available

36 | 41 | 42 |
43 | 44 |
45 |
46 | 84 |
85 |
86 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /docs/modules/sentence_handler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | sentence_handler — text-summarization 1.0 documentation 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 | 32 | 33 |
34 | 35 |

Source code for sentence_handler

36 |
 37 | from typing import List
 38 | 
 39 | import networkx
 40 | import numpy
 41 | import pandas
 42 | from networkx import PowerIterationFailedConvergence
 43 | from sklearn.preprocessing import LabelEncoder
 45 | 
 46 | 
 47 | 
[docs]def sentence_pairing(sentences: List[str]) -> pandas.DataFrame: 53 | """ 54 | Create a matrix of paired sentences, where same sentences are omitted. 55 | 56 | :param sentences: list of sentences 57 | :return: DataFrame with the columns ["sent_1", "sent_2"] where each row is a paired sentences. 58 | """ 59 | sent_pairs = [] 60 | for i in range(len(sentences)): 63 | for j in range(i, len(sentences)): 66 | if sentences[i] == sentences[j]: 69 | continue 70 | sent_pairs.append([sentences[i], sentences[j]]) 74 | return pandas.DataFrame(sent_pairs, columns=["sent_1", "sent_2"])
79 | 80 | 81 |
[docs]def sentence_rank_with_page_rank(sentence_pairs_with_score: pandas.DataFrame) -> pandas.DataFrame: 87 | """ 88 | Rank the sentences based on their similarity score to each other using page-rank algorithm and output their 89 | new scores. 90 | 91 | :param sentence_pairs_with_score: DataFrame with the columns ["sent_1", "sent_2", "score"] where each row is a paired sentences with their initial similarity score. 92 | :return: DataFrame with the columns ["sentence", "rank"] where each sentence has its rank. 93 | """ 94 | sentences = set() 95 | sentences.update(sentence_pairs_with_score["sent_1"].tolist()) 98 | sentences.update(sentence_pairs_with_score["sent_2"].tolist()) 101 | sentences_list = list() 102 | sentences_list.extend(sentences) 104 | le = LabelEncoder() 105 | le.fit(sentences_list) 107 | similarity_matrix = numpy.zeros((len(sentences_list), len(sentences_list))) 111 | for idx1 in range(len(sentences_list)): 114 | for idx2 in range(len(sentences_list)): 117 | if idx1 == idx2: 119 | # ignore if both are same sentences 120 | continue 121 | first_sent = sentences_list[idx1] 123 | second_sent = sentences_list[idx2] 125 | df = sentence_pairs_with_score[ 127 | (sentence_pairs_with_score["sent_1"] == first_sent) & ( 130 | sentence_pairs_with_score["sent_2"] == second_sent)] 132 | if df.shape[0] == 0: 135 | df = sentence_pairs_with_score[ 137 | (sentence_pairs_with_score["sent_1"] == second_sent) & (sentence_pairs_with_score[ 141 | "sent_2"] == first_sent)] 143 | 144 | similarity_matrix[le.transform([first_sent])[0]][le.transform([second_sent])[0]] = df["score"].iloc[0] 152 | sentence_similarity_graph = networkx.from_numpy_array(similarity_matrix) 155 | try: 156 | scores = networkx.pagerank(sentence_similarity_graph, max_iter=10_000) 160 | except PowerIterationFailedConvergence: 161 | scores = networkx.pagerank(sentence_similarity_graph, tol=1) 165 | result = pandas.DataFrame() 167 | result["sentence"] = scores.keys() 170 | result["sentence"] = le.inverse_transform(result["sentence"]) 174 | result["rank"] = scores.values() 177 | return result
178 | 179 | 180 |
[docs]def sentence_sorter(df: pandas.DataFrame, top_n: int, sentences: List[str]) -> str: 188 | """ 189 | Sort the sentences based on their rank and return the full summarized text in which the sentences appear as they are 190 | in the given text. 191 | 192 | :param df: DataFrame with the columns ["sentence", "rank"] where each sentence has its rank. 193 | :param top_n: total number of sentences in the summarized text. 194 | :param sentences: the given text tokenized into sentences. 195 | :return: the summarized text 196 | """ 197 | sorted_df = df.sort_values(by=["rank"], ascending=False) 201 | selected_sentences = sorted_df.head(top_n)["sentence"].tolist() 205 | result = [sentence for sentence in sentences if sentence in selected_sentences] 209 | return " ".join(result)
211 |
212 |
213 | 214 |
215 | 216 |
217 |
218 | 260 |
261 |
262 | 270 | 271 | 272 | 273 | -------------------------------------------------------------------------------- /docs/modules/wrappers/spacy_wrapper.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | wrappers.spacy_wrapper — text-summarization 1.0 documentation 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 | 32 | 33 |
34 | 35 |

Source code for wrappers.spacy_wrapper

36 |
 37 | from typing import List
 38 | 
 39 | import spacy
 40 | 
 41 | 
 42 | 
[docs]class SpacyWrapper: 45 | """ 46 | Wrapper object that load SpaCy module and helps use it. 47 | """ 48 | def __init__(self, spacy_module: str) -> None: 52 | try: 53 | self._nlp = spacy.load(spacy_module) 56 | except OSError: 57 | spacy.cli.download(spacy_module) 59 | self._nlp = spacy.load(spacy_module) 62 | 63 |
[docs] def sentence_tokenizer(self, text: str) -> List[str]: 69 | """ 70 | Tokenize (split) text in sentences. 71 | 72 | for example: 73 | sentence_tokenizer("Hello, world. Here are two sentences.") 74 | will output: 75 | ['Hello, world.', 'Here are two sentences.'] 76 | 77 | :param text: raw text to split into sentences 78 | :return: list of strings, each string is a sentence. 79 | """ 80 | doc = self._nlp(text) 82 | return [sent.string.strip() for sent in doc.sents]
86 |
87 |
88 | 89 |
90 | 91 |
92 |
93 | 136 |
137 |
138 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /docs/modules/wrappers/tensorflow_wrapper.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | wrappers.tensorflow_wrapper — text-summarization 1.0 documentation 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 | 32 | 33 |
34 | 35 |

Source code for wrappers.tensorflow_wrapper

36 |
 37 | import pandas
 38 | import tensorflow
 39 | import tensorflow_hub
 40 | 
 41 | 
 42 | 
[docs]class TensorFlowWrapper: 45 | """ 46 | Wrapper object for TensorFlow graph and helps use it. 47 | """ 48 | 49 | def __init__(self, embedding_layer_hub_name: str) -> None: 52 | g = tensorflow.Graph() 54 | with g.as_default(): 56 | # Import the Universal Sentence Encoder's TF Hub module 57 | embedding_layer = tensorflow_hub.Module(embedding_layer_hub_name) 60 | 61 | self._sts_input1 = tensorflow.placeholder(tensorflow.string, shape=None) 66 | self._sts_input2 = tensorflow.placeholder(tensorflow.string, shape=None) 71 | 72 | # For evaluation we use exactly normalized rather than approximately normalized. 73 | sts_encode1 = tensorflow.nn.l2_normalize(embedding_layer(self._sts_input1), axis=1) 78 | sts_encode2 = tensorflow.nn.l2_normalize(embedding_layer(self._sts_input2), axis=1) 83 | cosine_similarities = tensorflow.reduce_sum(tensorflow.multiply(sts_encode1, sts_encode2), 88 | axis=1) 90 | clip_cosine_similarities = tensorflow.clip_by_value(cosine_similarities, -1.0, 1.0) 95 | self._sim_scores = 1.0 - tensorflow.acos(clip_cosine_similarities) 99 | init_op = tensorflow.group([tensorflow.global_variables_initializer(), tensorflow.tables_initializer()]) 104 | g.finalize() 105 | 106 | self._session = tensorflow.Session(graph=g) 110 | self._session.run(init_op) 112 | 113 |
[docs] def append_scores(self, sentence_pairs: pandas.DataFrame) -> None: 119 | """ 120 | Appending scoring of cosine similarity based on the given embedding layer. 121 | 122 | :param sentence_pairs: DataFrame matrix of paired sentences with the columns ["sent_1", "sent_2"] where each row 123 | is a paired sentences. 124 | :return: None; it append to given DataFrame new column "score" with the cosine similarity score for each pair in 125 | each row. 126 | """ 127 | 128 | text_a = sentence_pairs["sent_1"].fillna("").tolist() 132 | text_b = sentence_pairs["sent_2"].fillna("").tolist() 136 | 137 | scores = self._session.run(self._sim_scores, feed_dict={self._sts_input1: text_a, self._sts_input2: text_b}) 145 | 146 | sentence_pairs["score"] = scores
148 | 149 |
[docs] def close(self): 153 | """ 154 | closes the TensorFlow session. 155 | """ 156 | self._session.close()
158 |
159 |
160 | 161 |
162 | 163 |
164 |
165 | 208 |
209 |
210 | 218 | 219 | 220 | 221 | -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idanmoradarthas/text-summarization/921252f9c135d77a1441d4de8c255f6a56c5331d/docs/objects.inv -------------------------------------------------------------------------------- /docs/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Python Module Index — text-summarization 1.0 documentation 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |
37 |
38 | 39 | 40 |
41 | 42 | 43 |

Python Module Index

44 | 45 |
46 | s 47 |
48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 59 | 60 | 61 | 62 | 63 | 66 | 68 | 69 |
 
58 | s
64 | sentence_handler 67 |
70 | 71 | 72 |
73 | 74 |
75 |
76 | 114 |
115 |
116 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Search — text-summarization 1.0 documentation 8 | 9 | 10 | 11 | 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 |

Search

41 |
42 | 43 |

44 | Please activate JavaScript to enable the search 45 | functionality. 46 |

47 |
48 |

49 | From here you can search these documents. Enter your search 50 | words into the box below and click "search". Note that the search 51 | function will automatically search for all of the words. Pages 52 | containing fewer words won't appear in the result list. 53 |

54 |
55 | 56 | 57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 |
68 | 96 |
97 |
98 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({docnames:["index","sentencehandler","spacywrapper","tensorflowwrapper"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["index.rst","sentencehandler.rst","spacywrapper.rst","tensorflowwrapper.rst"],objects:{"":{sentence_handler:[1,0,0,"-"]},"wrappers.spacy_wrapper":{SpacyWrapper:[2,2,1,""]},"wrappers.spacy_wrapper.SpacyWrapper":{sentence_tokenizer:[2,3,1,""]},"wrappers.tensorflow_wrapper":{TensorFlowWrapper:[3,2,1,""]},"wrappers.tensorflow_wrapper.TensorFlowWrapper":{append_scores:[3,3,1,""],close:[3,3,1,""]},sentence_handler:{sentence_pairing:[1,1,1,""],sentence_rank_with_page_rank:[1,1,1,""],sentence_sorter:[1,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method"},terms:{"c\u00e9spede":0,"class":[2,3],"int":1,"new":[1,3],"return":[1,2,3],The:0,about:[2,3],accord:0,across:0,algorithm:[0,1],all:[2,3],appear:1,append:3,append_scor:3,architectur:0,arxiv:0,auto:0,automat:0,back:[0,1,2,3],base:[0,1,3],below:0,brian:0,build:0,can:[2,3],cer:0,chri:0,close:3,column:[1,3],constant:0,content:0,core:[1,3],cosin:[0,3],creat:[0,1],daniel:0,datafram:[1,3],deep:0,dimension:0,dubei:0,each:[1,2,3],embed:[0,3],embedding_layer_hub_nam:3,exampl:2,flask:0,follow:0,frame:[1,3],framework:0,full:1,gener:0,github:[0,1,2,3],given:[0,1,3],graph:3,guajardo:0,handler:0,has:1,hello:2,help:[2,3],here:[2,3],hsuan:0,hua:0,implement:0,index:0,initi:1,input:0,inspir:0,its:1,itself:0,john:0,kong:0,kurzweil:0,layer:[0,3],learn:0,limtiaco:0,linguist:0,list:[1,2],load:2,major:0,mario:0,matrix:[0,1,3],modul:[0,2],nan:0,network:0,networkx:0,nicol:0,noah:0,none:3,number:1,object:[2,3],omit:1,ones:0,order:0,origin:0,other:1,output:[1,2],own:0,page:[0,1],pagerank:0,pair:[0,1,3],panda:[1,3],paramet:[1,2,3],pick:0,pictur:0,point:0,praveen:0,process:0,project:0,python:0,rai:0,rank:[0,1],raw:2,read:[0,2,3],restapi:0,rhomni:0,row:[1,3],same:1,score:[0,1,3],script:0,search:0,see:0,sent_1:[1,3],sent_2:[1,3],sentenc:[2,3],sentence_handl:1,sentence_pair:[1,3],sentence_pairs_with_scor:1,sentence_rank_with_page_rank:1,sentence_sort:1,sentence_token:2,session:3,sheng:0,shorten:0,similar:[0,1,3],softwar:0,sort:[0,1],sourc:[1,2,3],spaci:0,spacy_modul:2,spacy_wrapp:2,spacywrapp:2,split:[0,2],step:0,steve:0,str:[1,2,3],string:2,strope:0,summar:1,summari:0,sung:0,tar:0,tensorflow_wrapp:3,tensorflowwrapp:3,text:[1,2],thei:1,them:0,thi:0,token:[1,2],top:0,top_n:1,total:1,two:2,understand:0,use:[2,3],user:0,uses:0,using:[0,1],vector:0,where:[1,3],which:1,wikipedia:0,work:0,world:2,wrapper:0,yang:0,yinfei:0,you:[2,3],your:0,yuan:0,yun:0},titles:["Welcome to text-summarization\u2019s documentation!","Sentence Handler","SpaCy Wrapper","TensorFlow Wrapper"],titleterms:{document:0,encod:0,graph:0,handler:1,indic:0,introduct:0,refer:0,sentenc:[0,1],spaci:2,summar:0,tabl:0,tensorflow:[0,3],text:0,univers:0,welcom:0,wrapper:[2,3]}}) -------------------------------------------------------------------------------- /docs/sentencehandler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Sentence Handler — text-summarization 1.0 documentation 8 | 9 | 10 | 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 |

Sentence Handler

41 |
42 |
43 | sentence_handler.sentence_pairing(sentences: List[str]) → 46 | pandas.core.frame.DataFrame[source] 51 |
52 |

Create a matrix of paired sentences, where same sentences are omitted.

53 |
54 |
Parameters
55 |

sentences – list of sentences

56 |
57 |
Returns
58 |

DataFrame with the columns [“sent_1”, “sent_2”] where each row 59 | is a paired sentences.

60 |
61 |
62 |
63 |
64 | 65 |
66 |
67 | sentence_handler.sentence_rank_with_page_rank(sentence_pairs_with_score: 70 | pandas.core.frame.DataFrame) → 71 | pandas.core.frame.DataFrame[source] 76 |
77 |

Rank the sentences based on their similarity score to each other using page-rank 78 | algorithm and output their 79 | new scores.

80 |
81 |
Parameters
82 |

sentence_pairs_with_score – DataFrame with the 83 | columns [“sent_1”, “sent_2”, “score”] where each row is a paired sentences with 84 | their initial similarity score.

85 |
86 |
Returns
87 |

DataFrame with the columns [“sentence”, “rank”] where each 88 | sentence has its rank.

89 |
90 |
91 |
92 |
93 | 94 |
95 |
96 | sentence_handler.sentence_sorter(df: pandas.core.frame.DataFrame, top_n: int, sentences: List[str]) → str[source] 104 |
105 |

Sort the sentences based on their rank and return the full summarized text in which the 106 | sentences appear as they are 107 | in the given text.

108 |
109 |
Parameters
110 |
111 |
    112 |
  • df – DataFrame with the columns [“sentence”, “rank”] 113 | where each sentence has its rank.

  • 114 |
  • top_n – total number of sentences in the summarized 115 | text.

  • 116 |
  • sentences – the given text tokenized into sentences.

    117 |
  • 118 |
119 |
120 |
Returns
121 |

the summarized text

122 |
123 |
124 |
125 |
126 | 127 |

←back 128 | to github

129 |
130 | 131 | 132 |
133 | 134 |
135 |
136 | 176 |
177 |
178 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /docs/spacywrapper.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SpaCy Wrapper — text-summarization 1.0 documentation 8 | 9 | 10 | 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 |

SpaCy Wrapper

41 |

you can read all about Spacy here.

42 |
43 |
44 | class wrappers.spacy_wrapper.SpacyWrapper(spacy_module: str)[source] 51 |
52 |

Wrapper object that load SpaCy module and helps use it.

53 |
54 |
55 | sentence_tokenizer(text: str) → List[str][source] 62 |
63 |

Tokenize (split) text in sentences.

64 |
65 |
for example:
66 |

sentence_tokenizer(“Hello, world. Here are two sentences.”)

67 |
68 |
will output:
69 |

[‘Hello, world.’, ‘Here are two sentences.’]

70 |
71 |
72 |
73 |
Parameters
74 |

text – raw text to split into 75 | sentences

76 |
77 |
Returns
78 |

list of strings, each string is a sentence.

79 |
80 |
81 |
82 |
83 | 84 |
85 |
86 | 87 |

←back 88 | to github

89 |
90 | 91 | 92 |
93 | 94 |
95 |
96 | 137 |
138 |
139 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /docs/static/alabaster.css: -------------------------------------------------------------------------------- 1 | @import url("basic.css"); 2 | 3 | /* -- page layout ----------------------------------------------------------- */ 4 | 5 | body { 6 | font-family: Georgia, serif; 7 | font-size: 17px; 8 | background-color: #fff; 9 | color: #000; 10 | margin: 0; 11 | padding: 0; 12 | } 13 | 14 | 15 | div.document { 16 | width: 940px; 17 | margin: 30px auto 0 auto; 18 | } 19 | 20 | div.documentwrapper { 21 | float: left; 22 | width: 100%; 23 | } 24 | 25 | div.bodywrapper { 26 | margin: 0 0 0 220px; 27 | } 28 | 29 | div.sphinxsidebar { 30 | width: 220px; 31 | font-size: 14px; 32 | line-height: 1.5; 33 | } 34 | 35 | hr { 36 | border: 1px solid #B1B4B6; 37 | } 38 | 39 | div.body { 40 | background-color: #fff; 41 | color: #3E4349; 42 | padding: 0 30px 0 30px; 43 | } 44 | 45 | div.body > .section { 46 | text-align: left; 47 | } 48 | 49 | div.footer { 50 | width: 940px; 51 | margin: 20px auto 30px auto; 52 | font-size: 14px; 53 | color: #888; 54 | text-align: right; 55 | } 56 | 57 | div.footer a { 58 | color: #888; 59 | } 60 | 61 | p.caption { 62 | font-family: inherit; 63 | font-size: inherit; 64 | } 65 | 66 | 67 | div.relations { 68 | display: none; 69 | } 70 | 71 | 72 | div.sphinxsidebar a { 73 | color: #444; 74 | text-decoration: none; 75 | border-bottom: 1px dotted #999; 76 | } 77 | 78 | div.sphinxsidebar a:hover { 79 | border-bottom: 1px solid #999; 80 | } 81 | 82 | div.sphinxsidebarwrapper { 83 | padding: 18px 10px; 84 | } 85 | 86 | div.sphinxsidebarwrapper p.logo { 87 | padding: 0; 88 | margin: -10px 0 0 0px; 89 | text-align: center; 90 | } 91 | 92 | div.sphinxsidebarwrapper h1.logo { 93 | margin-top: -10px; 94 | text-align: center; 95 | margin-bottom: 5px; 96 | text-align: left; 97 | } 98 | 99 | div.sphinxsidebarwrapper h1.logo-name { 100 | margin-top: 0px; 101 | } 102 | 103 | div.sphinxsidebarwrapper p.blurb { 104 | margin-top: 0; 105 | font-style: normal; 106 | } 107 | 108 | div.sphinxsidebar h3, 109 | div.sphinxsidebar h4 { 110 | font-family: Georgia, serif; 111 | color: #444; 112 | font-size: 24px; 113 | font-weight: normal; 114 | margin: 0 0 5px 0; 115 | padding: 0; 116 | } 117 | 118 | div.sphinxsidebar h4 { 119 | font-size: 20px; 120 | } 121 | 122 | div.sphinxsidebar h3 a { 123 | color: #444; 124 | } 125 | 126 | div.sphinxsidebar p.logo a, 127 | div.sphinxsidebar h3 a, 128 | div.sphinxsidebar p.logo a:hover, 129 | div.sphinxsidebar h3 a:hover { 130 | border: none; 131 | } 132 | 133 | div.sphinxsidebar p { 134 | color: #555; 135 | margin: 10px 0; 136 | } 137 | 138 | div.sphinxsidebar ul { 139 | margin: 10px 0; 140 | padding: 0; 141 | color: #000; 142 | } 143 | 144 | div.sphinxsidebar ul li.toctree-l1 > a { 145 | font-size: 120%; 146 | } 147 | 148 | div.sphinxsidebar ul li.toctree-l2 > a { 149 | font-size: 110%; 150 | } 151 | 152 | div.sphinxsidebar input { 153 | border: 1px solid #CCC; 154 | font-family: Georgia, serif; 155 | font-size: 1em; 156 | } 157 | 158 | div.sphinxsidebar hr { 159 | border: none; 160 | height: 1px; 161 | color: #AAA; 162 | background: #AAA; 163 | 164 | text-align: left; 165 | margin-left: 0; 166 | width: 50%; 167 | } 168 | 169 | div.sphinxsidebar .badge { 170 | border-bottom: none; 171 | } 172 | 173 | div.sphinxsidebar .badge:hover { 174 | border-bottom: none; 175 | } 176 | 177 | /* To address an issue with donation coming after search */ 178 | div.sphinxsidebar h3.donation { 179 | margin-top: 10px; 180 | } 181 | 182 | /* -- body styles ----------------------------------------------------------- */ 183 | 184 | a { 185 | color: #004B6B; 186 | text-decoration: underline; 187 | } 188 | 189 | a:hover { 190 | color: #6D4100; 191 | text-decoration: underline; 192 | } 193 | 194 | div.body h1, 195 | div.body h2, 196 | div.body h3, 197 | div.body h4, 198 | div.body h5, 199 | div.body h6 { 200 | font-family: Georgia, serif; 201 | font-weight: normal; 202 | margin: 30px 0px 10px 0px; 203 | padding: 0; 204 | } 205 | 206 | div.body h1 { 207 | margin-top: 0; 208 | padding-top: 0; 209 | font-size: 240%; 210 | } 211 | 212 | div.body h2 { 213 | font-size: 180%; 214 | } 215 | 216 | div.body h3 { 217 | font-size: 150%; 218 | } 219 | 220 | div.body h4 { 221 | font-size: 130%; 222 | } 223 | 224 | div.body h5 { 225 | font-size: 100%; 226 | } 227 | 228 | div.body h6 { 229 | font-size: 100%; 230 | } 231 | 232 | a.headerlink { 233 | color: #DDD; 234 | padding: 0 4px; 235 | text-decoration: none; 236 | } 237 | 238 | a.headerlink:hover { 239 | color: #444; 240 | background: #EAEAEA; 241 | } 242 | 243 | div.body p, div.body dd, div.body li { 244 | line-height: 1.4em; 245 | } 246 | 247 | div.admonition { 248 | margin: 20px 0px; 249 | padding: 10px 30px; 250 | background-color: #EEE; 251 | border: 1px solid #CCC; 252 | } 253 | 254 | div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { 255 | background-color: #FBFBFB; 256 | border-bottom: 1px solid #fafafa; 257 | } 258 | 259 | div.admonition p.admonition-title { 260 | font-family: Georgia, serif; 261 | font-weight: normal; 262 | font-size: 24px; 263 | margin: 0 0 10px 0; 264 | padding: 0; 265 | line-height: 1; 266 | } 267 | 268 | div.admonition p.last { 269 | margin-bottom: 0; 270 | } 271 | 272 | div.highlight { 273 | background-color: #fff; 274 | } 275 | 276 | dt:target, .highlight { 277 | background: #FAF3E8; 278 | } 279 | 280 | div.warning { 281 | background-color: #FCC; 282 | border: 1px solid #FAA; 283 | } 284 | 285 | div.danger { 286 | background-color: #FCC; 287 | border: 1px solid #FAA; 288 | -moz-box-shadow: 2px 2px 4px #D52C2C; 289 | -webkit-box-shadow: 2px 2px 4px #D52C2C; 290 | box-shadow: 2px 2px 4px #D52C2C; 291 | } 292 | 293 | div.error { 294 | background-color: #FCC; 295 | border: 1px solid #FAA; 296 | -moz-box-shadow: 2px 2px 4px #D52C2C; 297 | -webkit-box-shadow: 2px 2px 4px #D52C2C; 298 | box-shadow: 2px 2px 4px #D52C2C; 299 | } 300 | 301 | div.caution { 302 | background-color: #FCC; 303 | border: 1px solid #FAA; 304 | } 305 | 306 | div.attention { 307 | background-color: #FCC; 308 | border: 1px solid #FAA; 309 | } 310 | 311 | div.important { 312 | background-color: #EEE; 313 | border: 1px solid #CCC; 314 | } 315 | 316 | div.note { 317 | background-color: #EEE; 318 | border: 1px solid #CCC; 319 | } 320 | 321 | div.tip { 322 | background-color: #EEE; 323 | border: 1px solid #CCC; 324 | } 325 | 326 | div.hint { 327 | background-color: #EEE; 328 | border: 1px solid #CCC; 329 | } 330 | 331 | div.seealso { 332 | background-color: #EEE; 333 | border: 1px solid #CCC; 334 | } 335 | 336 | div.topic { 337 | background-color: #EEE; 338 | } 339 | 340 | p.admonition-title { 341 | display: inline; 342 | } 343 | 344 | p.admonition-title:after { 345 | content: ":"; 346 | } 347 | 348 | pre, tt, code { 349 | font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; 350 | font-size: 0.9em; 351 | } 352 | 353 | .hll { 354 | background-color: #FFC; 355 | margin: 0 -12px; 356 | padding: 0 12px; 357 | display: block; 358 | } 359 | 360 | img.screenshot { 361 | } 362 | 363 | tt.descname, tt.descclassname, code.descname, code.descclassname { 364 | font-size: 0.95em; 365 | } 366 | 367 | tt.descname, code.descname { 368 | padding-right: 0.08em; 369 | } 370 | 371 | img.screenshot { 372 | -moz-box-shadow: 2px 2px 4px #EEE; 373 | -webkit-box-shadow: 2px 2px 4px #EEE; 374 | box-shadow: 2px 2px 4px #EEE; 375 | } 376 | 377 | table.docutils { 378 | border: 1px solid #888; 379 | -moz-box-shadow: 2px 2px 4px #EEE; 380 | -webkit-box-shadow: 2px 2px 4px #EEE; 381 | box-shadow: 2px 2px 4px #EEE; 382 | } 383 | 384 | table.docutils td, table.docutils th { 385 | border: 1px solid #888; 386 | padding: 0.25em 0.7em; 387 | } 388 | 389 | table.field-list, table.footnote { 390 | border: none; 391 | -moz-box-shadow: none; 392 | -webkit-box-shadow: none; 393 | box-shadow: none; 394 | } 395 | 396 | table.footnote { 397 | margin: 15px 0; 398 | width: 100%; 399 | border: 1px solid #EEE; 400 | background: #FDFDFD; 401 | font-size: 0.9em; 402 | } 403 | 404 | table.footnote + table.footnote { 405 | margin-top: -15px; 406 | border-top: none; 407 | } 408 | 409 | table.field-list th { 410 | padding: 0 0.8em 0 0; 411 | } 412 | 413 | table.field-list td { 414 | padding: 0; 415 | } 416 | 417 | table.field-list p { 418 | margin-bottom: 0.8em; 419 | } 420 | 421 | /* Cloned from 422 | * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68 423 | */ 424 | .field-name { 425 | -moz-hyphens: manual; 426 | -ms-hyphens: manual; 427 | -webkit-hyphens: manual; 428 | hyphens: manual; 429 | } 430 | 431 | table.footnote td.label { 432 | width: .1px; 433 | padding: 0.3em 0 0.3em 0.5em; 434 | } 435 | 436 | table.footnote td { 437 | padding: 0.3em 0.5em; 438 | } 439 | 440 | dl { 441 | margin: 0; 442 | padding: 0; 443 | } 444 | 445 | dl dd { 446 | margin-left: 30px; 447 | } 448 | 449 | blockquote { 450 | margin: 0 0 0 30px; 451 | padding: 0; 452 | } 453 | 454 | ul, ol { 455 | /* Matches the 30px from the narrow-screen "li > ul" selector below */ 456 | margin: 10px 0 10px 30px; 457 | padding: 0; 458 | } 459 | 460 | pre { 461 | background: #EEE; 462 | padding: 7px 30px; 463 | margin: 15px 0px; 464 | line-height: 1.3em; 465 | } 466 | 467 | div.viewcode-block:target { 468 | background: #ffd; 469 | } 470 | 471 | dl pre, blockquote pre, li pre { 472 | margin-left: 0; 473 | padding-left: 30px; 474 | } 475 | 476 | tt, code { 477 | background-color: #ecf0f3; 478 | color: #222; 479 | /* padding: 1px 2px; */ 480 | } 481 | 482 | tt.xref, code.xref, a tt { 483 | background-color: #FBFBFB; 484 | border-bottom: 1px solid #fff; 485 | } 486 | 487 | a.reference { 488 | text-decoration: none; 489 | border-bottom: 1px dotted #004B6B; 490 | } 491 | 492 | /* Don't put an underline on images */ 493 | a.image-reference, a.image-reference:hover { 494 | border-bottom: none; 495 | } 496 | 497 | a.reference:hover { 498 | border-bottom: 1px solid #6D4100; 499 | } 500 | 501 | a.footnote-reference { 502 | text-decoration: none; 503 | font-size: 0.7em; 504 | vertical-align: top; 505 | border-bottom: 1px dotted #004B6B; 506 | } 507 | 508 | a.footnote-reference:hover { 509 | border-bottom: 1px solid #6D4100; 510 | } 511 | 512 | a:hover tt, a:hover code { 513 | background: #EEE; 514 | } 515 | 516 | 517 | @media screen and (max-width: 870px) { 518 | 519 | div.sphinxsidebar { 520 | display: none; 521 | } 522 | 523 | div.document { 524 | width: 100%; 525 | 526 | } 527 | 528 | div.documentwrapper { 529 | margin-left: 0; 530 | margin-top: 0; 531 | margin-right: 0; 532 | margin-bottom: 0; 533 | } 534 | 535 | div.bodywrapper { 536 | margin-top: 0; 537 | margin-right: 0; 538 | margin-bottom: 0; 539 | margin-left: 0; 540 | } 541 | 542 | ul { 543 | margin-left: 0; 544 | } 545 | 546 | li > ul { 547 | /* Matches the 30px from the "ul, ol" selector above */ 548 | margin-left: 30px; 549 | } 550 | 551 | .document { 552 | width: auto; 553 | } 554 | 555 | .footer { 556 | width: auto; 557 | } 558 | 559 | .bodywrapper { 560 | margin: 0; 561 | } 562 | 563 | .footer { 564 | width: auto; 565 | } 566 | 567 | .github { 568 | display: none; 569 | } 570 | 571 | 572 | 573 | } 574 | 575 | 576 | 577 | @media screen and (max-width: 875px) { 578 | 579 | body { 580 | margin: 0; 581 | padding: 20px 30px; 582 | } 583 | 584 | div.documentwrapper { 585 | float: none; 586 | background: #fff; 587 | } 588 | 589 | div.sphinxsidebar { 590 | display: block; 591 | float: none; 592 | width: 102.5%; 593 | margin: 50px -30px -20px -30px; 594 | padding: 10px 20px; 595 | background: #333; 596 | color: #FFF; 597 | } 598 | 599 | div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, 600 | div.sphinxsidebar h3 a { 601 | color: #fff; 602 | } 603 | 604 | div.sphinxsidebar a { 605 | color: #AAA; 606 | } 607 | 608 | div.sphinxsidebar p.logo { 609 | display: none; 610 | } 611 | 612 | div.document { 613 | width: 100%; 614 | margin: 0; 615 | } 616 | 617 | div.footer { 618 | display: none; 619 | } 620 | 621 | div.bodywrapper { 622 | margin: 0; 623 | } 624 | 625 | div.body { 626 | min-height: 0; 627 | padding: 0; 628 | } 629 | 630 | .rtd_doc_footer { 631 | display: none; 632 | } 633 | 634 | .document { 635 | width: auto; 636 | } 637 | 638 | .footer { 639 | width: auto; 640 | } 641 | 642 | .footer { 643 | width: auto; 644 | } 645 | 646 | .github { 647 | display: none; 648 | } 649 | } 650 | 651 | 652 | /* misc. */ 653 | 654 | .revsys-inline { 655 | display: none !important; 656 | } 657 | 658 | /* Make nested-list/multi-paragraph items look better in Releases changelog 659 | * pages. Without this, docutils' magical list fuckery causes inconsistent 660 | * formatting between different release sub-lists. 661 | */ 662 | div#changelog > div.section > ul > li > p:only-child { 663 | margin-bottom: 0; 664 | } 665 | 666 | /* Hide fugly table cell borders in ..bibliography:: directive output */ 667 | table.docutils.citation, table.docutils.citation td, table.docutils.citation th { 668 | border: none; 669 | /* Below needed in some edge cases; if not applied, bottom shadows appear */ 670 | -moz-box-shadow: none; 671 | -webkit-box-shadow: none; 672 | box-shadow: none; 673 | } 674 | 675 | 676 | /* relbar */ 677 | 678 | .related { 679 | line-height: 30px; 680 | width: 100%; 681 | font-size: 0.9rem; 682 | } 683 | 684 | .related.top { 685 | border-bottom: 1px solid #EEE; 686 | margin-bottom: 20px; 687 | } 688 | 689 | .related.bottom { 690 | border-top: 1px solid #EEE; 691 | } 692 | 693 | .related ul { 694 | padding: 0; 695 | margin: 0; 696 | list-style: none; 697 | } 698 | 699 | .related li { 700 | display: inline; 701 | } 702 | 703 | nav#rellinks { 704 | float: right; 705 | } 706 | 707 | nav#rellinks li + li:before { 708 | content: "|"; 709 | } 710 | 711 | nav#breadcrumbs li + li:before { 712 | content: "\00BB"; 713 | } 714 | 715 | /* Hide certain items when printing */ 716 | @media print { 717 | div.related { 718 | display: none; 719 | } 720 | } -------------------------------------------------------------------------------- /docs/static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | word-wrap: break-word; 56 | overflow-wrap: break-word; 57 | } 58 | 59 | div.sphinxsidebar ul { 60 | list-style: none; 61 | } 62 | 63 | div.sphinxsidebar ul ul, 64 | div.sphinxsidebar ul.want-points { 65 | margin-left: 20px; 66 | list-style: square; 67 | } 68 | 69 | div.sphinxsidebar ul ul { 70 | margin-top: 0; 71 | margin-bottom: 0; 72 | } 73 | 74 | div.sphinxsidebar form { 75 | margin-top: 10px; 76 | } 77 | 78 | div.sphinxsidebar input { 79 | border: 1px solid #98dbcc; 80 | font-family: sans-serif; 81 | font-size: 1em; 82 | } 83 | 84 | div.sphinxsidebar #searchbox form.search { 85 | overflow: hidden; 86 | } 87 | 88 | div.sphinxsidebar #searchbox input[type="text"] { 89 | float: left; 90 | width: 80%; 91 | padding: 0.25em; 92 | box-sizing: border-box; 93 | } 94 | 95 | div.sphinxsidebar #searchbox input[type="submit"] { 96 | float: left; 97 | width: 20%; 98 | border-left: none; 99 | padding: 0.25em; 100 | box-sizing: border-box; 101 | } 102 | 103 | 104 | img { 105 | border: 0; 106 | max-width: 100%; 107 | } 108 | 109 | /* -- search page ----------------------------------------------------------- */ 110 | 111 | ul.search { 112 | margin: 10px 0 0 20px; 113 | padding: 0; 114 | } 115 | 116 | ul.search li { 117 | padding: 5px 0 5px 20px; 118 | background-image: url(file.png); 119 | background-repeat: no-repeat; 120 | background-position: 0 7px; 121 | } 122 | 123 | ul.search li a { 124 | font-weight: bold; 125 | } 126 | 127 | ul.search li div.context { 128 | color: #888; 129 | margin: 2px 0 0 30px; 130 | text-align: left; 131 | } 132 | 133 | ul.keywordmatches li.goodmatch a { 134 | font-weight: bold; 135 | } 136 | 137 | /* -- index page ------------------------------------------------------------ */ 138 | 139 | table.contentstable { 140 | width: 90%; 141 | margin-left: auto; 142 | margin-right: auto; 143 | } 144 | 145 | table.contentstable p.biglink { 146 | line-height: 150%; 147 | } 148 | 149 | a.biglink { 150 | font-size: 1.3em; 151 | } 152 | 153 | span.linkdescr { 154 | font-style: italic; 155 | padding-top: 5px; 156 | font-size: 90%; 157 | } 158 | 159 | /* -- general index --------------------------------------------------------- */ 160 | 161 | table.indextable { 162 | width: 100%; 163 | } 164 | 165 | table.indextable td { 166 | text-align: left; 167 | vertical-align: top; 168 | } 169 | 170 | table.indextable ul { 171 | margin-top: 0; 172 | margin-bottom: 0; 173 | list-style-type: none; 174 | } 175 | 176 | table.indextable > tbody > tr > td > ul { 177 | padding-left: 0em; 178 | } 179 | 180 | table.indextable tr.pcap { 181 | height: 10px; 182 | } 183 | 184 | table.indextable tr.cap { 185 | margin-top: 10px; 186 | background-color: #f2f2f2; 187 | } 188 | 189 | img.toggler { 190 | margin-right: 3px; 191 | margin-top: 3px; 192 | cursor: pointer; 193 | } 194 | 195 | div.modindex-jumpbox { 196 | border-top: 1px solid #ddd; 197 | border-bottom: 1px solid #ddd; 198 | margin: 1em 0 1em 0; 199 | padding: 0.4em; 200 | } 201 | 202 | div.genindex-jumpbox { 203 | border-top: 1px solid #ddd; 204 | border-bottom: 1px solid #ddd; 205 | margin: 1em 0 1em 0; 206 | padding: 0.4em; 207 | } 208 | 209 | /* -- domain module index --------------------------------------------------- */ 210 | 211 | table.modindextable td { 212 | padding: 2px; 213 | border-collapse: collapse; 214 | } 215 | 216 | /* -- general body styles --------------------------------------------------- */ 217 | 218 | div.body { 219 | min-width: 450px; 220 | max-width: 800px; 221 | } 222 | 223 | div.body p, div.body dd, div.body li, div.body blockquote { 224 | -moz-hyphens: auto; 225 | -ms-hyphens: auto; 226 | -webkit-hyphens: auto; 227 | hyphens: auto; 228 | } 229 | 230 | a.headerlink { 231 | visibility: hidden; 232 | } 233 | 234 | a.brackets:before, 235 | span.brackets > a:before { 236 | content: "["; 237 | } 238 | 239 | a.brackets:after, 240 | span.brackets > a:after { 241 | content: "]"; 242 | } 243 | 244 | h1:hover > a.headerlink, 245 | h2:hover > a.headerlink, 246 | h3:hover > a.headerlink, 247 | h4:hover > a.headerlink, 248 | h5:hover > a.headerlink, 249 | h6:hover > a.headerlink, 250 | dt:hover > a.headerlink, 251 | caption:hover > a.headerlink, 252 | p.caption:hover > a.headerlink, 253 | div.code-block-caption:hover > a.headerlink { 254 | visibility: visible; 255 | } 256 | 257 | div.body p.caption { 258 | text-align: inherit; 259 | } 260 | 261 | div.body td { 262 | text-align: left; 263 | } 264 | 265 | .first { 266 | margin-top: 0 !important; 267 | } 268 | 269 | p.rubric { 270 | margin-top: 30px; 271 | font-weight: bold; 272 | } 273 | 274 | img.align-left, .figure.align-left, object.align-left { 275 | clear: left; 276 | float: left; 277 | margin-right: 1em; 278 | } 279 | 280 | img.align-right, .figure.align-right, object.align-right { 281 | clear: right; 282 | float: right; 283 | margin-left: 1em; 284 | } 285 | 286 | img.align-center, .figure.align-center, object.align-center { 287 | display: block; 288 | margin-left: auto; 289 | margin-right: auto; 290 | } 291 | 292 | img.align-default, .figure.align-default { 293 | display: block; 294 | margin-left: auto; 295 | margin-right: auto; 296 | } 297 | 298 | .align-left { 299 | text-align: left; 300 | } 301 | 302 | .align-center { 303 | text-align: center; 304 | } 305 | 306 | .align-default { 307 | text-align: center; 308 | } 309 | 310 | .align-right { 311 | text-align: right; 312 | } 313 | 314 | /* -- sidebars -------------------------------------------------------------- */ 315 | 316 | div.sidebar { 317 | margin: 0 0 0.5em 1em; 318 | border: 1px solid #ddb; 319 | padding: 7px 7px 0 7px; 320 | background-color: #ffe; 321 | width: 40%; 322 | float: right; 323 | } 324 | 325 | p.sidebar-title { 326 | font-weight: bold; 327 | } 328 | 329 | /* -- topics ---------------------------------------------------------------- */ 330 | 331 | div.topic { 332 | border: 1px solid #ccc; 333 | padding: 7px 7px 0 7px; 334 | margin: 10px 0 10px 0; 335 | } 336 | 337 | p.topic-title { 338 | font-size: 1.1em; 339 | font-weight: bold; 340 | margin-top: 10px; 341 | } 342 | 343 | /* -- admonitions ----------------------------------------------------------- */ 344 | 345 | div.admonition { 346 | margin-top: 10px; 347 | margin-bottom: 10px; 348 | padding: 7px; 349 | } 350 | 351 | div.admonition dt { 352 | font-weight: bold; 353 | } 354 | 355 | div.admonition dl { 356 | margin-bottom: 0; 357 | } 358 | 359 | p.admonition-title { 360 | margin: 0px 10px 5px 0px; 361 | font-weight: bold; 362 | } 363 | 364 | div.body p.centered { 365 | text-align: center; 366 | margin-top: 25px; 367 | } 368 | 369 | /* -- tables ---------------------------------------------------------------- */ 370 | 371 | table.docutils { 372 | border: 0; 373 | border-collapse: collapse; 374 | } 375 | 376 | table.align-center { 377 | margin-left: auto; 378 | margin-right: auto; 379 | } 380 | 381 | table.align-default { 382 | margin-left: auto; 383 | margin-right: auto; 384 | } 385 | 386 | table caption span.caption-number { 387 | font-style: italic; 388 | } 389 | 390 | table caption span.caption-text { 391 | } 392 | 393 | table.docutils td, table.docutils th { 394 | padding: 1px 8px 1px 5px; 395 | border-top: 0; 396 | border-left: 0; 397 | border-right: 0; 398 | border-bottom: 1px solid #aaa; 399 | } 400 | 401 | table.footnote td, table.footnote th { 402 | border: 0 !important; 403 | } 404 | 405 | th { 406 | text-align: left; 407 | padding-right: 5px; 408 | } 409 | 410 | table.citation { 411 | border-left: solid 1px gray; 412 | margin-left: 1px; 413 | } 414 | 415 | table.citation td { 416 | border-bottom: none; 417 | } 418 | 419 | th > p:first-child, 420 | td > p:first-child { 421 | margin-top: 0px; 422 | } 423 | 424 | th > p:last-child, 425 | td > p:last-child { 426 | margin-bottom: 0px; 427 | } 428 | 429 | /* -- figures --------------------------------------------------------------- */ 430 | 431 | div.figure { 432 | margin: 0.5em; 433 | padding: 0.5em; 434 | } 435 | 436 | div.figure p.caption { 437 | padding: 0.3em; 438 | } 439 | 440 | div.figure p.caption span.caption-number { 441 | font-style: italic; 442 | } 443 | 444 | div.figure p.caption span.caption-text { 445 | } 446 | 447 | /* -- field list styles ----------------------------------------------------- */ 448 | 449 | table.field-list td, table.field-list th { 450 | border: 0 !important; 451 | } 452 | 453 | .field-list ul { 454 | margin: 0; 455 | padding-left: 1em; 456 | } 457 | 458 | .field-list p { 459 | margin: 0; 460 | } 461 | 462 | .field-name { 463 | -moz-hyphens: manual; 464 | -ms-hyphens: manual; 465 | -webkit-hyphens: manual; 466 | hyphens: manual; 467 | } 468 | 469 | /* -- hlist styles ---------------------------------------------------------- */ 470 | 471 | table.hlist td { 472 | vertical-align: top; 473 | } 474 | 475 | 476 | /* -- other body styles ----------------------------------------------------- */ 477 | 478 | ol.arabic { 479 | list-style: decimal; 480 | } 481 | 482 | ol.loweralpha { 483 | list-style: lower-alpha; 484 | } 485 | 486 | ol.upperalpha { 487 | list-style: upper-alpha; 488 | } 489 | 490 | ol.lowerroman { 491 | list-style: lower-roman; 492 | } 493 | 494 | ol.upperroman { 495 | list-style: upper-roman; 496 | } 497 | 498 | li > p:first-child { 499 | margin-top: 0px; 500 | } 501 | 502 | li > p:last-child { 503 | margin-bottom: 0px; 504 | } 505 | 506 | dl.footnote > dt, 507 | dl.citation > dt { 508 | float: left; 509 | } 510 | 511 | dl.footnote > dd, 512 | dl.citation > dd { 513 | margin-bottom: 0em; 514 | } 515 | 516 | dl.footnote > dd:after, 517 | dl.citation > dd:after { 518 | content: ""; 519 | clear: both; 520 | } 521 | 522 | dl.field-list { 523 | display: grid; 524 | grid-template-columns: fit-content(30%) auto; 525 | } 526 | 527 | dl.field-list > dt { 528 | font-weight: bold; 529 | word-break: break-word; 530 | padding-left: 0.5em; 531 | padding-right: 5px; 532 | } 533 | 534 | dl.field-list > dt:after { 535 | content: ":"; 536 | } 537 | 538 | dl.field-list > dd { 539 | padding-left: 0.5em; 540 | margin-top: 0em; 541 | margin-left: 0em; 542 | margin-bottom: 0em; 543 | } 544 | 545 | dl { 546 | margin-bottom: 15px; 547 | } 548 | 549 | dd > p:first-child { 550 | margin-top: 0px; 551 | } 552 | 553 | dd ul, dd table { 554 | margin-bottom: 10px; 555 | } 556 | 557 | dd { 558 | margin-top: 3px; 559 | margin-bottom: 10px; 560 | margin-left: 30px; 561 | } 562 | 563 | dt:target, span.highlighted { 564 | background-color: #fbe54e; 565 | } 566 | 567 | rect.highlighted { 568 | fill: #fbe54e; 569 | } 570 | 571 | dl.glossary dt { 572 | font-weight: bold; 573 | font-size: 1.1em; 574 | } 575 | 576 | .optional { 577 | font-size: 1.3em; 578 | } 579 | 580 | .sig-paren { 581 | font-size: larger; 582 | } 583 | 584 | .versionmodified { 585 | font-style: italic; 586 | } 587 | 588 | .system-message { 589 | background-color: #fda; 590 | padding: 5px; 591 | border: 3px solid red; 592 | } 593 | 594 | .footnote:target { 595 | background-color: #ffa; 596 | } 597 | 598 | .line-block { 599 | display: block; 600 | margin-top: 1em; 601 | margin-bottom: 1em; 602 | } 603 | 604 | .line-block .line-block { 605 | margin-top: 0; 606 | margin-bottom: 0; 607 | margin-left: 1.5em; 608 | } 609 | 610 | .guilabel, .menuselection { 611 | font-family: sans-serif; 612 | } 613 | 614 | .accelerator { 615 | text-decoration: underline; 616 | } 617 | 618 | .classifier { 619 | font-style: oblique; 620 | } 621 | 622 | .classifier:before { 623 | font-style: normal; 624 | margin: 0.5em; 625 | content: ":"; 626 | } 627 | 628 | abbr, acronym { 629 | border-bottom: dotted 1px; 630 | cursor: help; 631 | } 632 | 633 | /* -- code displays --------------------------------------------------------- */ 634 | 635 | pre { 636 | overflow: auto; 637 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 638 | } 639 | 640 | span.pre { 641 | -moz-hyphens: none; 642 | -ms-hyphens: none; 643 | -webkit-hyphens: none; 644 | hyphens: none; 645 | } 646 | 647 | td.linenos pre { 648 | padding: 5px 0px; 649 | border: 0; 650 | background-color: transparent; 651 | color: #aaa; 652 | } 653 | 654 | table.highlighttable { 655 | margin-left: 0.5em; 656 | } 657 | 658 | table.highlighttable td { 659 | padding: 0 0.5em 0 0.5em; 660 | } 661 | 662 | div.code-block-caption { 663 | padding: 2px 5px; 664 | font-size: small; 665 | } 666 | 667 | div.code-block-caption code { 668 | background-color: transparent; 669 | } 670 | 671 | div.code-block-caption + div > div.highlight > pre { 672 | margin-top: 0; 673 | } 674 | 675 | div.code-block-caption span.caption-number { 676 | padding: 0.1em 0.3em; 677 | font-style: italic; 678 | } 679 | 680 | div.code-block-caption span.caption-text { 681 | } 682 | 683 | div.literal-block-wrapper { 684 | padding: 1em 1em 0; 685 | } 686 | 687 | div.literal-block-wrapper div.highlight { 688 | margin: 0; 689 | } 690 | 691 | code.descname { 692 | background-color: transparent; 693 | font-weight: bold; 694 | font-size: 1.2em; 695 | } 696 | 697 | code.descclassname { 698 | background-color: transparent; 699 | } 700 | 701 | code.xref, a code { 702 | background-color: transparent; 703 | font-weight: bold; 704 | } 705 | 706 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 707 | background-color: transparent; 708 | } 709 | 710 | .viewcode-link { 711 | float: right; 712 | } 713 | 714 | .viewcode-back { 715 | float: right; 716 | font-family: sans-serif; 717 | } 718 | 719 | div.viewcode-block:target { 720 | margin: -1px -10px; 721 | padding: 0 10px; 722 | } 723 | 724 | /* -- math display ---------------------------------------------------------- */ 725 | 726 | img.math { 727 | vertical-align: middle; 728 | } 729 | 730 | div.body div.math p { 731 | text-align: center; 732 | } 733 | 734 | span.eqno { 735 | float: right; 736 | } 737 | 738 | span.eqno a.headerlink { 739 | position: relative; 740 | left: 0px; 741 | z-index: 1; 742 | } 743 | 744 | div.math:hover a.headerlink { 745 | visibility: visible; 746 | } 747 | 748 | /* -- printout stylesheet --------------------------------------------------- */ 749 | 750 | @media print { 751 | div.document, 752 | div.documentwrapper, 753 | div.bodywrapper { 754 | margin: 0 !important; 755 | width: 100%; 756 | } 757 | 758 | div.sphinxsidebar, 759 | div.related, 760 | div.footer, 761 | #top-link { 762 | display: none; 763 | } 764 | } -------------------------------------------------------------------------------- /docs/static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /docs/static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function (x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function (s) { 48 | if (typeof s === 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function (text, className) { 69 | function highlight(node, addItems) { 70 | if (node.nodeType === 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && 74 | !jQuery(node.parentNode).hasClass(className) && 75 | !jQuery(node.parentNode).hasClass("nohighlight")) { 76 | var span; 77 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 78 | if (isInSVG) { 79 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 80 | } else { 81 | span = document.createElement("span"); 82 | span.className = className; 83 | } 84 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 85 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 86 | document.createTextNode(val.substr(pos + text.length)), 87 | node.nextSibling)); 88 | node.nodeValue = val.substr(0, pos); 89 | if (isInSVG) { 90 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 91 | var bbox = node.parentElement.getBBox(); 92 | rect.x.baseVal.value = bbox.x; 93 | rect.y.baseVal.value = bbox.y; 94 | rect.width.baseVal.value = bbox.width; 95 | rect.height.baseVal.value = bbox.height; 96 | rect.setAttribute('class', className); 97 | addItems.push({ 98 | "parent": node.parentNode, 99 | "target": rect 100 | }); 101 | } 102 | } 103 | } else if (!jQuery(node).is("button, select, textarea")) { 104 | jQuery.each(node.childNodes, function () { 105 | highlight(this, addItems); 106 | }); 107 | } 108 | } 109 | 110 | var addItems = []; 111 | var result = this.each(function () { 112 | highlight(this, addItems); 113 | }); 114 | for (var i = 0; i < addItems.length; ++i) { 115 | jQuery(addItems[i].parent).before(addItems[i].target); 116 | } 117 | return result; 118 | }; 119 | 120 | /* 121 | * backward compatibility for jQuery.browser 122 | * This will be supported until firefox bug is fixed. 123 | */ 124 | if (!jQuery.browser) { 125 | jQuery.uaMatch = function (ua) { 126 | ua = ua.toLowerCase(); 127 | 128 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 129 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 130 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 131 | /(msie) ([\w.]+)/.exec(ua) || 132 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 133 | []; 134 | 135 | return { 136 | browser: match[1] || "", 137 | version: match[2] || "0" 138 | }; 139 | }; 140 | jQuery.browser = {}; 141 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 142 | } 143 | 144 | /** 145 | * Small JavaScript module for the documentation. 146 | */ 147 | var Documentation = { 148 | 149 | init: function () { 150 | this.fixFirefoxAnchorBug(); 151 | this.highlightSearchWords(); 152 | this.initIndexTable(); 153 | if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { 154 | this.initOnKeyListeners(); 155 | } 156 | }, 157 | 158 | /** 159 | * i18n support 160 | */ 161 | TRANSLATIONS: {}, 162 | PLURAL_EXPR: function (n) { 163 | return n === 1 ? 0 : 1; 164 | }, 165 | LOCALE: 'unknown', 166 | 167 | // gettext and ngettext don't access this so that the functions 168 | // can safely bound to a different name (_ = Documentation.gettext) 169 | gettext: function (string) { 170 | var translated = Documentation.TRANSLATIONS[string]; 171 | if (typeof translated === 'undefined') 172 | return string; 173 | return (typeof translated === 'string') ? translated : translated[0]; 174 | }, 175 | 176 | ngettext: function (singular, plural, n) { 177 | var translated = Documentation.TRANSLATIONS[singular]; 178 | if (typeof translated === 'undefined') 179 | return (n == 1) ? singular : plural; 180 | return translated[Documentation.PLURALEXPR(n)]; 181 | }, 182 | 183 | addTranslations: function (catalog) { 184 | for (var key in catalog.messages) 185 | this.TRANSLATIONS[key] = catalog.messages[key]; 186 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 187 | this.LOCALE = catalog.locale; 188 | }, 189 | 190 | /** 191 | * add context elements like header anchor links 192 | */ 193 | addContextElements: function () { 194 | $('div[id] > :header:first').each(function () { 195 | $('\u00B6').attr('href', '#' + this.id).attr('title', _('Permalink to this headline')).appendTo(this); 196 | }); 197 | $('dt[id]').each(function () { 198 | $('\u00B6').attr('href', '#' + this.id).attr('title', _('Permalink to this definition')).appendTo(this); 199 | }); 200 | }, 201 | 202 | /** 203 | * workaround a firefox stupidity 204 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 205 | */ 206 | fixFirefoxAnchorBug: function () { 207 | if (document.location.hash && $.browser.mozilla) 208 | window.setTimeout(function () { 209 | document.location.href += ''; 210 | }, 10); 211 | }, 212 | 213 | /** 214 | * highlight the search words provided in the url in the text 215 | */ 216 | highlightSearchWords: function () { 217 | var params = $.getQueryParameters(); 218 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 219 | if (terms.length) { 220 | var body = $('div.body'); 221 | if (!body.length) { 222 | body = $('body'); 223 | } 224 | window.setTimeout(function () { 225 | $.each(terms, function () { 226 | body.highlightText(this.toLowerCase(), 'highlighted'); 227 | }); 228 | }, 10); 229 | $('') 231 | .appendTo($('#searchbox')); 232 | } 233 | }, 234 | 235 | /** 236 | * init the domain index toggle buttons 237 | */ 238 | initIndexTable: function () { 239 | var togglers = $('img.toggler').click(function () { 240 | var src = $(this).attr('src'); 241 | var idnum = $(this).attr('id').substr(7); 242 | $('tr.cg-' + idnum).toggle(); 243 | if (src.substr(-9) === 'minus.png') 244 | $(this).attr('src', src.substr(0, src.length - 9) + 'plus.png'); 245 | else 246 | $(this).attr('src', src.substr(0, src.length - 8) + 'minus.png'); 247 | }).css('display', ''); 248 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 249 | togglers.click(); 250 | } 251 | }, 252 | 253 | /** 254 | * helper function to hide the search marks again 255 | */ 256 | hideSearchWords: function () { 257 | $('#searchbox .highlight-link').fadeOut(300); 258 | $('span.highlighted').removeClass('highlighted'); 259 | }, 260 | 261 | /** 262 | * make the url absolute 263 | */ 264 | makeURL: function (relativeURL) { 265 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 266 | }, 267 | 268 | /** 269 | * get the current relative url 270 | */ 271 | getCurrentURL: function () { 272 | var path = document.location.pathname; 273 | var parts = path.split(/\//); 274 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function () { 275 | if (this === '..') 276 | parts.pop(); 277 | }); 278 | var url = parts.join('/'); 279 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 280 | }, 281 | 282 | initOnKeyListeners: function () { 283 | $(document).keyup(function (event) { 284 | var activeElementType = document.activeElement.tagName; 285 | // don't navigate when in search box or textarea 286 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 287 | switch (event.keyCode) { 288 | case 37: // left 289 | var prevHref = $('link[rel="prev"]').prop('href'); 290 | if (prevHref) { 291 | window.location.href = prevHref; 292 | return false; 293 | } 294 | case 39: // right 295 | var nextHref = $('link[rel="next"]').prop('href'); 296 | if (nextHref) { 297 | window.location.href = nextHref; 298 | return false; 299 | } 300 | } 301 | } 302 | }); 303 | } 304 | }; 305 | 306 | // quick alias for translations 307 | _ = Documentation.gettext; 308 | 309 | $(document).ready(function () { 310 | Documentation.init(); 311 | }); 312 | -------------------------------------------------------------------------------- /docs/static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '1.0', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | FILE_SUFFIX: '.html', 7 | HAS_SOURCE: true, 8 | SOURCELINK_SUFFIX: '.txt', 9 | NAVIGATION_WITH_KEYS: false 10 | }; -------------------------------------------------------------------------------- /docs/static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idanmoradarthas/text-summarization/921252f9c135d77a1441d4de8c255f6a56c5331d/docs/static/file.png -------------------------------------------------------------------------------- /docs/static/language_data.js: -------------------------------------------------------------------------------- 1 | /* 2 | * language_data.js 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * This script contains the language-specific data used by searchtools.js, 6 | * namely the list of stopwords, stemmer, scorer and splitter. 7 | * 8 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 9 | * :license: BSD, see LICENSE for details. 10 | * 11 | */ 12 | 13 | var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; 14 | 15 | 16 | /* Non-minified version JS is _stemmer.js if file is provided */ 17 | /** 18 | * Porter Stemmer 19 | */ 20 | var Stemmer = function () { 21 | 22 | var step2list = { 23 | ational: 'ate', 24 | tional: 'tion', 25 | enci: 'ence', 26 | anci: 'ance', 27 | izer: 'ize', 28 | bli: 'ble', 29 | alli: 'al', 30 | entli: 'ent', 31 | eli: 'e', 32 | ousli: 'ous', 33 | ization: 'ize', 34 | ation: 'ate', 35 | ator: 'ate', 36 | alism: 'al', 37 | iveness: 'ive', 38 | fulness: 'ful', 39 | ousness: 'ous', 40 | aliti: 'al', 41 | iviti: 'ive', 42 | biliti: 'ble', 43 | logi: 'log' 44 | }; 45 | 46 | var step3list = { 47 | icate: 'ic', 48 | ative: '', 49 | alize: 'al', 50 | iciti: 'ic', 51 | ical: 'ic', 52 | ful: '', 53 | ness: '' 54 | }; 55 | 56 | var c = "[^aeiou]"; // consonant 57 | var v = "[aeiouy]"; // vowel 58 | var C = c + "[^aeiouy]*"; // consonant sequence 59 | var V = v + "[aeiou]*"; // vowel sequence 60 | 61 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 62 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 63 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 64 | var s_v = "^(" + C + ")?" + v; // vowel in stem 65 | 66 | this.stemWord = function (w) { 67 | var stem; 68 | var suffix; 69 | var firstch; 70 | var origword = w; 71 | 72 | if (w.length < 3) 73 | return w; 74 | 75 | var re; 76 | var re2; 77 | var re3; 78 | var re4; 79 | 80 | firstch = w.substr(0, 1); 81 | if (firstch == "y") 82 | w = firstch.toUpperCase() + w.substr(1); 83 | 84 | // Step 1a 85 | re = /^(.+?)(ss|i)es$/; 86 | re2 = /^(.+?)([^s])s$/; 87 | 88 | if (re.test(w)) 89 | w = w.replace(re, "$1$2"); 90 | else if (re2.test(w)) 91 | w = w.replace(re2, "$1$2"); 92 | 93 | // Step 1b 94 | re = /^(.+?)eed$/; 95 | re2 = /^(.+?)(ed|ing)$/; 96 | if (re.test(w)) { 97 | var fp = re.exec(w); 98 | re = new RegExp(mgr0); 99 | if (re.test(fp[1])) { 100 | re = /.$/; 101 | w = w.replace(re, ""); 102 | } 103 | } else if (re2.test(w)) { 104 | var fp = re2.exec(w); 105 | stem = fp[1]; 106 | re2 = new RegExp(s_v); 107 | if (re2.test(stem)) { 108 | w = stem; 109 | re2 = /(at|bl|iz)$/; 110 | re3 = new RegExp("([^aeiouylsz])\\1$"); 111 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 112 | if (re2.test(w)) 113 | w = w + "e"; 114 | else if (re3.test(w)) { 115 | re = /.$/; 116 | w = w.replace(re, ""); 117 | } else if (re4.test(w)) 118 | w = w + "e"; 119 | } 120 | } 121 | 122 | // Step 1c 123 | re = /^(.+?)y$/; 124 | if (re.test(w)) { 125 | var fp = re.exec(w); 126 | stem = fp[1]; 127 | re = new RegExp(s_v); 128 | if (re.test(stem)) 129 | w = stem + "i"; 130 | } 131 | 132 | // Step 2 133 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 134 | if (re.test(w)) { 135 | var fp = re.exec(w); 136 | stem = fp[1]; 137 | suffix = fp[2]; 138 | re = new RegExp(mgr0); 139 | if (re.test(stem)) 140 | w = stem + step2list[suffix]; 141 | } 142 | 143 | // Step 3 144 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 145 | if (re.test(w)) { 146 | var fp = re.exec(w); 147 | stem = fp[1]; 148 | suffix = fp[2]; 149 | re = new RegExp(mgr0); 150 | if (re.test(stem)) 151 | w = stem + step3list[suffix]; 152 | } 153 | 154 | // Step 4 155 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 156 | re2 = /^(.+?)(s|t)(ion)$/; 157 | if (re.test(w)) { 158 | var fp = re.exec(w); 159 | stem = fp[1]; 160 | re = new RegExp(mgr1); 161 | if (re.test(stem)) 162 | w = stem; 163 | } else if (re2.test(w)) { 164 | var fp = re2.exec(w); 165 | stem = fp[1] + fp[2]; 166 | re2 = new RegExp(mgr1); 167 | if (re2.test(stem)) 168 | w = stem; 169 | } 170 | 171 | // Step 5 172 | re = /^(.+?)e$/; 173 | if (re.test(w)) { 174 | var fp = re.exec(w); 175 | stem = fp[1]; 176 | re = new RegExp(mgr1); 177 | re2 = new RegExp(meq1); 178 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 179 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 180 | w = stem; 181 | } 182 | re = /ll$/; 183 | re2 = new RegExp(mgr1); 184 | if (re.test(w) && re2.test(w)) { 185 | re = /.$/; 186 | w = w.replace(re, ""); 187 | } 188 | 189 | // and turn initial Y back to y 190 | if (firstch == "y") 191 | w = firstch.toLowerCase() + w.substr(1); 192 | return w; 193 | } 194 | } 195 | 196 | 197 | var splitChars = (function () { 198 | var result = {}; 199 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 200 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 201 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 202 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 203 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 204 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 205 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 206 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 207 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 208 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 209 | var i, j, start, end; 210 | for (i = 0; i < singles.length; i++) { 211 | result[singles[i]] = true; 212 | } 213 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 214 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 215 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 216 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 217 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 218 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 219 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 220 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 221 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 222 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 223 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 224 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 225 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 226 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 227 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 228 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 229 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 230 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 231 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 232 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 233 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 234 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 235 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 236 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 237 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 238 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 239 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 240 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 241 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 242 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 243 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 244 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 245 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 246 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 247 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 248 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 249 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 250 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 251 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 252 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 253 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 254 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 255 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 256 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 257 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 258 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 259 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 260 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 261 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 262 | for (i = 0; i < ranges.length; i++) { 263 | start = ranges[i][0]; 264 | end = ranges[i][1]; 265 | for (j = start; j <= end; j++) { 266 | result[j] = true; 267 | } 268 | } 269 | return result; 270 | })(); 271 | 272 | function splitQuery(query) { 273 | var result = []; 274 | var start = -1; 275 | for (var i = 0; i < query.length; i++) { 276 | if (splitChars[query.charCodeAt(i)]) { 277 | if (start !== -1) { 278 | result.push(query.slice(start, i)); 279 | start = -1; 280 | } 281 | } else if (start === -1) { 282 | start = i; 283 | } 284 | } 285 | if (start !== -1) { 286 | result.push(query.slice(start)); 287 | } 288 | return result; 289 | } 290 | 291 | 292 | -------------------------------------------------------------------------------- /docs/static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idanmoradarthas/text-summarization/921252f9c135d77a1441d4de8c255f6a56c5331d/docs/static/minus.png -------------------------------------------------------------------------------- /docs/static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idanmoradarthas/text-summarization/921252f9c135d77a1441d4de8c255f6a56c5331d/docs/static/plus.png -------------------------------------------------------------------------------- /docs/static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { 2 | background-color: #ffffcc 3 | } 4 | 5 | .highlight { 6 | background: #f8f8f8; 7 | } 8 | 9 | .highlight .c { 10 | color: #8f5902; 11 | font-style: italic 12 | } 13 | 14 | /* Comment */ 15 | .highlight .err { 16 | color: #a40000; 17 | border: 1px solid #ef2929 18 | } 19 | 20 | /* Error */ 21 | .highlight .g { 22 | color: #000000 23 | } 24 | 25 | /* Generic */ 26 | .highlight .k { 27 | color: #004461; 28 | font-weight: bold 29 | } 30 | 31 | /* Keyword */ 32 | .highlight .l { 33 | color: #000000 34 | } 35 | 36 | /* Literal */ 37 | .highlight .n { 38 | color: #000000 39 | } 40 | 41 | /* Name */ 42 | .highlight .o { 43 | color: #582800 44 | } 45 | 46 | /* Operator */ 47 | .highlight .x { 48 | color: #000000 49 | } 50 | 51 | /* Other */ 52 | .highlight .p { 53 | color: #000000; 54 | font-weight: bold 55 | } 56 | 57 | /* Punctuation */ 58 | .highlight .ch { 59 | color: #8f5902; 60 | font-style: italic 61 | } 62 | 63 | /* Comment.Hashbang */ 64 | .highlight .cm { 65 | color: #8f5902; 66 | font-style: italic 67 | } 68 | 69 | /* Comment.Multiline */ 70 | .highlight .cp { 71 | color: #8f5902 72 | } 73 | 74 | /* Comment.Preproc */ 75 | .highlight .cpf { 76 | color: #8f5902; 77 | font-style: italic 78 | } 79 | 80 | /* Comment.PreprocFile */ 81 | .highlight .c1 { 82 | color: #8f5902; 83 | font-style: italic 84 | } 85 | 86 | /* Comment.Single */ 87 | .highlight .cs { 88 | color: #8f5902; 89 | font-style: italic 90 | } 91 | 92 | /* Comment.Special */ 93 | .highlight .gd { 94 | color: #a40000 95 | } 96 | 97 | /* Generic.Deleted */ 98 | .highlight .ge { 99 | color: #000000; 100 | font-style: italic 101 | } 102 | 103 | /* Generic.Emph */ 104 | .highlight .gr { 105 | color: #ef2929 106 | } 107 | 108 | /* Generic.Error */ 109 | .highlight .gh { 110 | color: #000080; 111 | font-weight: bold 112 | } 113 | 114 | /* Generic.Heading */ 115 | .highlight .gi { 116 | color: #00A000 117 | } 118 | 119 | /* Generic.Inserted */ 120 | .highlight .go { 121 | color: #888888 122 | } 123 | 124 | /* Generic.Output */ 125 | .highlight .gp { 126 | color: #745334 127 | } 128 | 129 | /* Generic.Prompt */ 130 | .highlight .gs { 131 | color: #000000; 132 | font-weight: bold 133 | } 134 | 135 | /* Generic.Strong */ 136 | .highlight .gu { 137 | color: #800080; 138 | font-weight: bold 139 | } 140 | 141 | /* Generic.Subheading */ 142 | .highlight .gt { 143 | color: #a40000; 144 | font-weight: bold 145 | } 146 | 147 | /* Generic.Traceback */ 148 | .highlight .kc { 149 | color: #004461; 150 | font-weight: bold 151 | } 152 | 153 | /* Keyword.Constant */ 154 | .highlight .kd { 155 | color: #004461; 156 | font-weight: bold 157 | } 158 | 159 | /* Keyword.Declaration */ 160 | .highlight .kn { 161 | color: #004461; 162 | font-weight: bold 163 | } 164 | 165 | /* Keyword.Namespace */ 166 | .highlight .kp { 167 | color: #004461; 168 | font-weight: bold 169 | } 170 | 171 | /* Keyword.Pseudo */ 172 | .highlight .kr { 173 | color: #004461; 174 | font-weight: bold 175 | } 176 | 177 | /* Keyword.Reserved */ 178 | .highlight .kt { 179 | color: #004461; 180 | font-weight: bold 181 | } 182 | 183 | /* Keyword.Type */ 184 | .highlight .ld { 185 | color: #000000 186 | } 187 | 188 | /* Literal.Date */ 189 | .highlight .m { 190 | color: #990000 191 | } 192 | 193 | /* Literal.Number */ 194 | .highlight .s { 195 | color: #4e9a06 196 | } 197 | 198 | /* Literal.String */ 199 | .highlight .na { 200 | color: #c4a000 201 | } 202 | 203 | /* Name.Attribute */ 204 | .highlight .nb { 205 | color: #004461 206 | } 207 | 208 | /* Name.Builtin */ 209 | .highlight .nc { 210 | color: #000000 211 | } 212 | 213 | /* Name.Class */ 214 | .highlight .no { 215 | color: #000000 216 | } 217 | 218 | /* Name.Constant */ 219 | .highlight .nd { 220 | color: #888888 221 | } 222 | 223 | /* Name.Decorator */ 224 | .highlight .ni { 225 | color: #ce5c00 226 | } 227 | 228 | /* Name.Entity */ 229 | .highlight .ne { 230 | color: #cc0000; 231 | font-weight: bold 232 | } 233 | 234 | /* Name.Exception */ 235 | .highlight .nf { 236 | color: #000000 237 | } 238 | 239 | /* Name.Function */ 240 | .highlight .nl { 241 | color: #f57900 242 | } 243 | 244 | /* Name.Label */ 245 | .highlight .nn { 246 | color: #000000 247 | } 248 | 249 | /* Name.Namespace */ 250 | .highlight .nx { 251 | color: #000000 252 | } 253 | 254 | /* Name.Other */ 255 | .highlight .py { 256 | color: #000000 257 | } 258 | 259 | /* Name.Property */ 260 | .highlight .nt { 261 | color: #004461; 262 | font-weight: bold 263 | } 264 | 265 | /* Name.Tag */ 266 | .highlight .nv { 267 | color: #000000 268 | } 269 | 270 | /* Name.Variable */ 271 | .highlight .ow { 272 | color: #004461; 273 | font-weight: bold 274 | } 275 | 276 | /* Operator.Word */ 277 | .highlight .w { 278 | color: #f8f8f8; 279 | text-decoration: underline 280 | } 281 | 282 | /* Text.Whitespace */ 283 | .highlight .mb { 284 | color: #990000 285 | } 286 | 287 | /* Literal.Number.Bin */ 288 | .highlight .mf { 289 | color: #990000 290 | } 291 | 292 | /* Literal.Number.Float */ 293 | .highlight .mh { 294 | color: #990000 295 | } 296 | 297 | /* Literal.Number.Hex */ 298 | .highlight .mi { 299 | color: #990000 300 | } 301 | 302 | /* Literal.Number.Integer */ 303 | .highlight .mo { 304 | color: #990000 305 | } 306 | 307 | /* Literal.Number.Oct */ 308 | .highlight .sa { 309 | color: #4e9a06 310 | } 311 | 312 | /* Literal.String.Affix */ 313 | .highlight .sb { 314 | color: #4e9a06 315 | } 316 | 317 | /* Literal.String.Backtick */ 318 | .highlight .sc { 319 | color: #4e9a06 320 | } 321 | 322 | /* Literal.String.Char */ 323 | .highlight .dl { 324 | color: #4e9a06 325 | } 326 | 327 | /* Literal.String.Delimiter */ 328 | .highlight .sd { 329 | color: #8f5902; 330 | font-style: italic 331 | } 332 | 333 | /* Literal.String.Doc */ 334 | .highlight .s2 { 335 | color: #4e9a06 336 | } 337 | 338 | /* Literal.String.Double */ 339 | .highlight .se { 340 | color: #4e9a06 341 | } 342 | 343 | /* Literal.String.Escape */ 344 | .highlight .sh { 345 | color: #4e9a06 346 | } 347 | 348 | /* Literal.String.Heredoc */ 349 | .highlight .si { 350 | color: #4e9a06 351 | } 352 | 353 | /* Literal.String.Interpol */ 354 | .highlight .sx { 355 | color: #4e9a06 356 | } 357 | 358 | /* Literal.String.Other */ 359 | .highlight .sr { 360 | color: #4e9a06 361 | } 362 | 363 | /* Literal.String.Regex */ 364 | .highlight .s1 { 365 | color: #4e9a06 366 | } 367 | 368 | /* Literal.String.Single */ 369 | .highlight .ss { 370 | color: #4e9a06 371 | } 372 | 373 | /* Literal.String.Symbol */ 374 | .highlight .bp { 375 | color: #3465a4 376 | } 377 | 378 | /* Name.Builtin.Pseudo */ 379 | .highlight .fm { 380 | color: #000000 381 | } 382 | 383 | /* Name.Function.Magic */ 384 | .highlight .vc { 385 | color: #000000 386 | } 387 | 388 | /* Name.Variable.Class */ 389 | .highlight .vg { 390 | color: #000000 391 | } 392 | 393 | /* Name.Variable.Global */ 394 | .highlight .vi { 395 | color: #000000 396 | } 397 | 398 | /* Name.Variable.Instance */ 399 | .highlight .vm { 400 | color: #000000 401 | } 402 | 403 | /* Name.Variable.Magic */ 404 | .highlight .il { 405 | color: #990000 406 | } 407 | 408 | /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/static/searchtools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * searchtools.js 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for the full-text search. 6 | * 7 | * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | if (!Scorer) { 13 | /** 14 | * Simple result scoring code. 15 | */ 16 | var Scorer = { 17 | // Implement the following function to further tweak the score for each result 18 | // The function takes a result array [filename, title, anchor, descr, score] 19 | // and returns the new score. 20 | /* 21 | score: function(result) { 22 | return result[4]; 23 | }, 24 | */ 25 | 26 | // query matches the full name of an object 27 | objNameMatch: 11, 28 | // or matches in the last dotted part of the object name 29 | objPartialMatch: 6, 30 | // Additive scores depending on the priority of the object 31 | objPrio: { 32 | 0: 15, // used to be importantResults 33 | 1: 5, // used to be objectResults 34 | 2: -5 35 | }, // used to be unimportantResults 36 | // Used when the priority is not in the mapping. 37 | objPrioDefault: 0, 38 | 39 | // query found in title 40 | title: 15, 41 | partialTitle: 7, 42 | // query found in terms 43 | term: 5, 44 | partialTerm: 2 45 | }; 46 | } 47 | 48 | if (!splitQuery) { 49 | function splitQuery(query) { 50 | return query.split(/\s+/); 51 | } 52 | } 53 | 54 | /** 55 | * Search Module 56 | */ 57 | var Search = { 58 | 59 | _index: null, 60 | _queued_query: null, 61 | _pulse_status: -1, 62 | 63 | htmlToText: function (htmlString) { 64 | var htmlElement = document.createElement('span'); 65 | htmlElement.innerHTML = htmlString; 66 | $(htmlElement).find('.headerlink').remove(); 67 | docContent = $(htmlElement).find('[role=main]')[0]; 68 | return docContent.textContent || docContent.innerText; 69 | }, 70 | 71 | init: function () { 72 | var params = $.getQueryParameters(); 73 | if (params.q) { 74 | var query = params.q[0]; 75 | $('input[name="q"]')[0].value = query; 76 | this.performSearch(query); 77 | } 78 | }, 79 | 80 | loadIndex: function (url) { 81 | $.ajax({ 82 | type: "GET", url: url, data: null, 83 | dataType: "script", cache: true, 84 | complete: function (jqxhr, textstatus) { 85 | if (textstatus != "success") { 86 | document.getElementById("searchindexloader").src = url; 87 | } 88 | } 89 | }); 90 | }, 91 | 92 | setIndex: function (index) { 93 | var q; 94 | this._index = index; 95 | if ((q = this._queued_query) !== null) { 96 | this._queued_query = null; 97 | Search.query(q); 98 | } 99 | }, 100 | 101 | hasIndex: function () { 102 | return this._index !== null; 103 | }, 104 | 105 | deferQuery: function (query) { 106 | this._queued_query = query; 107 | }, 108 | 109 | stopPulse: function () { 110 | this._pulse_status = 0; 111 | }, 112 | 113 | startPulse: function () { 114 | if (this._pulse_status >= 0) 115 | return; 116 | 117 | function pulse() { 118 | var i; 119 | Search._pulse_status = (Search._pulse_status + 1) % 4; 120 | var dotString = ''; 121 | for (i = 0; i < Search._pulse_status; i++) 122 | dotString += '.'; 123 | Search.dots.text(dotString); 124 | if (Search._pulse_status > -1) 125 | window.setTimeout(pulse, 500); 126 | } 127 | 128 | pulse(); 129 | }, 130 | 131 | /** 132 | * perform a search for something (or wait until index is loaded) 133 | */ 134 | performSearch: function (query) { 135 | // create the required interface elements 136 | this.out = $('#search-results'); 137 | this.title = $('

' + _('Searching') + '

').appendTo(this.out); 138 | this.dots = $('').appendTo(this.title); 139 | this.status = $('

 

').appendTo(this.out); 140 | this.output = $('