This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import streamlit as st | |
| from transformers import BartTokenizer, BartForConditionalGeneration | |
| from transformers import T5Tokenizer, T5ForConditionalGeneration | |
| st.title('Text Summarization Demo') | |
| st.markdown('Using BART and T5 transformer model') | |
| model = st.selectbox('Select the model', ('BART', 'T5')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import plotly.graph_objects as go | |
| import pandas as pd | |
| def serp_heatmap(df, num_domains=10, select_domain=None): | |
| df = df.rename(columns={'domain': 'displayLink', | |
| 'searchTerms': 'keyword'}) | |
| top_domains = df['displayLink'].value_counts()[:num_domains].index.tolist() | |
| top_domains = df['displayLink'].value_counts()[:num_domains].index.tolist() | |
| top_df = df[df['displayLink'].isin(top_domains) & df['displayLink'].ne('')] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # TIPS | |
| 1) Remove the count function and paste into dev tools to test further | |
| 2) To spot additonal oportunities swap the img selector to video, iframe or wildcards | |
| 3) Render JS in SF to discover all images and spot differences | |
| 4) Spot check source to find different lazy loading libraries e.g. Lazysizes, JQuery Lazy, yall.js etc | |
| # CAVEATS | |
| 1) Don't forget to check background CSS images | |
| 2) Other implimentaiton techniques may exist, adapt this approach to suit your needs e.g yall.js - lazy-bg-loaded |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yaml_config=""" | |
| input_features: | |
| - | |
| name: Original_Title | |
| type: text | |
| level: word | |
| encoder: t5 | |
| reduce_output: null | |
| - | |
| name: Keyword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * A bookmarklet for viewing the largest contentful paint in a page. | |
| * Will show each LCP after the bookmarklet is clicked. | |
| * | |
| * To install: | |
| * 1. Copy the code starting from the line beginning `javascript:` | |
| * 2. Add a new bookmark in Chrome, and paste the code in as the URL. | |
| **/ | |
| javascript:(function(){ | |
| try { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from selenium.common.exceptions import NoSuchElementException | |
| from selenium.webdriver.chrome.options import Options | |
| from selenium import webdriver | |
| from bs4 import BeautifulSoup | |
| import xlsxwriter | |
| import datetime | |
| import time | |
| import os | |
| def returnChromeDriver(pathToChromeDriver): |