mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
add reflector local-only scripts
This commit is contained in:
BIN
reflector-local/.DS_Store
vendored
Normal file
BIN
reflector-local/.DS_Store
vendored
Normal file
Binary file not shown.
30
reflector-local/0-reflector-local.py
Normal file
30
reflector-local/0-reflector-local.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
|
# Get the input file name from the command line argument
|
||||||
|
input_file = sys.argv[1]
|
||||||
|
# example use: python 0-reflector-local.py input.m4a agenda.txt
|
||||||
|
|
||||||
|
# Get the agenda file name from the command line argument if provided
|
||||||
|
if len(sys.argv) > 2:
|
||||||
|
agenda_file = sys.argv[2]
|
||||||
|
else:
|
||||||
|
agenda_file = "agenda.txt"
|
||||||
|
# example use: python 0-reflector-local.py input.m4a my_agenda.txt
|
||||||
|
|
||||||
|
# Check if the agenda file exists
|
||||||
|
if not os.path.exists(agenda_file):
|
||||||
|
logger.error("agenda_file is missing")
|
||||||
|
|
||||||
|
# Check if the input file is .m4a, if so convert to .mp4
|
||||||
|
if input_file.endswith(".m4a"):
|
||||||
|
subprocess.run(["ffmpeg", "-i", input_file, f"{input_file}.mp4"])
|
||||||
|
input_file = f"{input_file}.mp4"
|
||||||
|
|
||||||
|
# Run the first script to generate the transcript
|
||||||
|
subprocess.run(["python3", "1-transcript-generator.py", input_file, f"{input_file}_transcript.txt"])
|
||||||
|
|
||||||
|
# Run the second script to compare the transcript to the agenda
|
||||||
|
subprocess.run(["python3", "2-agenda-transcript-diff.py", agenda_file, f"{input_file}_transcript.txt"])
|
||||||
57
reflector-local/1-transcript-generator.py
Executable file
57
reflector-local/1-transcript-generator.py
Executable file
@@ -0,0 +1,57 @@
|
|||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import moviepy.editor
|
||||||
|
from loguru import logger
|
||||||
|
import whisper
|
||||||
|
|
||||||
|
WHISPER_MODEL_SIZE = "base"
|
||||||
|
|
||||||
|
def init_argparse() -> argparse.ArgumentParser:
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
usage="%(prog)s <LOCATION> <OUTPUT>",
|
||||||
|
description="Creates a transcript of a video or audio file using the OpenAI Whisper model"
|
||||||
|
)
|
||||||
|
parser.add_argument("location", help="Location of the media file")
|
||||||
|
parser.add_argument("output", help="Output file path")
|
||||||
|
return parser
|
||||||
|
|
||||||
|
def main():
|
||||||
|
import sys
|
||||||
|
sys.setrecursionlimit(10000)
|
||||||
|
|
||||||
|
parser = init_argparse()
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
media_file = args.location
|
||||||
|
logger.info(f"Processing file: {media_file}")
|
||||||
|
|
||||||
|
# Check if the media file is a valid audio or video file
|
||||||
|
if os.path.isfile(media_file) and not media_file.endswith(('.mp3', '.wav', '.ogg', '.flac', '.mp4', '.avi', '.flv')):
|
||||||
|
logger.error(f"Invalid file format: {media_file}")
|
||||||
|
return
|
||||||
|
|
||||||
|
# If the media file we just retrieved is an audio file then skip extraction step
|
||||||
|
audio_filename = media_file
|
||||||
|
logger.info(f"Found audio-only file, skipping audio extraction")
|
||||||
|
|
||||||
|
audio = moviepy.editor.AudioFileClip(audio_filename)
|
||||||
|
|
||||||
|
logger.info("Selected extracted audio")
|
||||||
|
|
||||||
|
# Transcribe the audio file using the OpenAI Whisper model
|
||||||
|
logger.info("Loading Whisper speech-to-text model")
|
||||||
|
whisper_model = whisper.load_model(WHISPER_MODEL_SIZE)
|
||||||
|
|
||||||
|
logger.info(f"Transcribing file: {media_file}")
|
||||||
|
whisper_result = whisper_model.transcribe(media_file)
|
||||||
|
|
||||||
|
logger.info("Finished transcribing file")
|
||||||
|
|
||||||
|
# Save the transcript to the specified file.
|
||||||
|
logger.info(f"Saving transcript to: {args.output}")
|
||||||
|
transcript_file = open(args.output, "w")
|
||||||
|
transcript_file.write(whisper_result["text"])
|
||||||
|
transcript_file.close()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
64
reflector-local/2-agenda-transcript-diff.py
Normal file
64
reflector-local/2-agenda-transcript-diff.py
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import argparse
|
||||||
|
import spacy
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
|
# Define the paths for agenda and transcription files
|
||||||
|
def init_argparse() -> argparse.ArgumentParser:
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
usage="%(prog)s <AGENDA> <TRANSCRIPTION>",
|
||||||
|
description="Compares the transcript of a video or audio file to an agenda using the SpaCy model"
|
||||||
|
)
|
||||||
|
parser.add_argument("agenda", help="Location of the agenda file")
|
||||||
|
parser.add_argument("transcription", help="Location of the transcription file")
|
||||||
|
return parser
|
||||||
|
args = init_argparse().parse_args()
|
||||||
|
agenda_path = args.agenda
|
||||||
|
transcription_path = args.transcription
|
||||||
|
|
||||||
|
# Load the spaCy model and add the sentencizer
|
||||||
|
spaCy_model = "en_core_web_md"
|
||||||
|
nlp = spacy.load(spaCy_model)
|
||||||
|
nlp.add_pipe('sentencizer')
|
||||||
|
logger.info("Loaded spaCy model " + spaCy_model )
|
||||||
|
|
||||||
|
# Load the agenda
|
||||||
|
with open(agenda_path, "r") as f:
|
||||||
|
agenda = [line.strip() for line in f.readlines() if line.strip()]
|
||||||
|
logger.info("Loaded agenda items")
|
||||||
|
|
||||||
|
# Load the transcription
|
||||||
|
with open(transcription_path, "r") as f:
|
||||||
|
transcription = f.read()
|
||||||
|
logger.info("Loaded transcription")
|
||||||
|
|
||||||
|
# Tokenize the transcription using spaCy
|
||||||
|
doc_transcription = nlp(transcription)
|
||||||
|
logger.info("Tokenized transcription")
|
||||||
|
|
||||||
|
# Find the items covered in the transcription
|
||||||
|
covered_items = {}
|
||||||
|
for item in agenda:
|
||||||
|
item_doc = nlp(item)
|
||||||
|
for sent in doc_transcription.sents:
|
||||||
|
if not sent or not all(token.has_vector for token in sent):
|
||||||
|
# Skip an empty span or one without any word vectors
|
||||||
|
continue
|
||||||
|
similarity = sent.similarity(item_doc)
|
||||||
|
similarity_threshold = 0.7
|
||||||
|
if similarity > similarity_threshold: # Set the threshold to determine what is considered a match
|
||||||
|
covered_items[item] = True
|
||||||
|
break
|
||||||
|
|
||||||
|
# Count the number of items covered and calculatre the percentage
|
||||||
|
num_covered_items = sum(covered_items.values())
|
||||||
|
percentage_covered = num_covered_items / len(agenda) * 100
|
||||||
|
|
||||||
|
# Print the results
|
||||||
|
print("💬 Agenda items covered in the transcription:")
|
||||||
|
for item in agenda:
|
||||||
|
if item in covered_items and covered_items[item]:
|
||||||
|
print("✅ ", item)
|
||||||
|
else:
|
||||||
|
print("❌ ", item)
|
||||||
|
print("📊 Coverage: {:.2f}%".format(percentage_covered))
|
||||||
|
logger.info("Finished comparing agenda to transcription with similarity threshold of " + str(similarity_threshold))
|
||||||
4
reflector-local/30min-CyberHR/30min-CyberHR-agenda.txt
Normal file
4
reflector-local/30min-CyberHR/30min-CyberHR-agenda.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Deloitte HR @ NYS Cybersecurity Conference
|
||||||
|
- ways to retain and grow your workforce
|
||||||
|
- how to enable cybersecurity professionals to do their best work
|
||||||
|
- low-budget activities that can be implemented starting tomorrow
|
||||||
File diff suppressed because one or more lines are too long
BIN
reflector-local/30min-CyberHR/30min-CyberHR.m4a
Normal file
BIN
reflector-local/30min-CyberHR/30min-CyberHR.m4a
Normal file
Binary file not shown.
@@ -0,0 +1,47 @@
|
|||||||
|
AGENDA: Most important things to look for in a start up
|
||||||
|
|
||||||
|
TAM: Make sure the market is sufficiently large than once they win they can get rewarded
|
||||||
|
- Medium sized markets that should be winner take all can work
|
||||||
|
- TAM needs to be realistic of direct market size
|
||||||
|
|
||||||
|
Product market fit: Being in a good market with a product than can satisfy that market
|
||||||
|
- Solves a problem
|
||||||
|
- Builds a solution a customer wants to buy
|
||||||
|
- Either saves the customer something (time/money/pain) or gives them something (revenue/enjoyment)
|
||||||
|
|
||||||
|
Unit economics: Profit for delivering all-in cost must be attractive (% or $ amount)
|
||||||
|
- Revenue minus direct costs
|
||||||
|
- Raw input costs (materials, variable labour), direct cost of delivering and servicing the sale
|
||||||
|
- Attractive as a % of sales so it can contribute to fixed overhead
|
||||||
|
- Look for high incremental contribution margin
|
||||||
|
|
||||||
|
LTV CAC: Life-time value (revenue contribution) vs cost to acquire customer must be healthy
|
||||||
|
- LTV = Purchase value x number of purchases x customer lifespan
|
||||||
|
- CAC = All-in costs of sales + marketing over number of new customer additions
|
||||||
|
- Strong reputation leads to referrals leads to lower CAC. Want customers evangelizing product/service
|
||||||
|
- Rule of thumb higher than 3
|
||||||
|
|
||||||
|
Churn: Fits into LTV, low churn leads to higher LTV and helps keep future CAC down
|
||||||
|
- Selling to replenish revenue every year is hard
|
||||||
|
- Can run through entire customer base over time
|
||||||
|
- Low churn builds strong net dollar retention
|
||||||
|
|
||||||
|
Business: Must have sufficient barriers to entry to ward off copy-cats once established
|
||||||
|
- High switching costs (lock-in)
|
||||||
|
- Addictive
|
||||||
|
- Steep learning curve once adopted (form of switching cost)
|
||||||
|
- Two sided liquidity
|
||||||
|
- Patents, IP, Branding
|
||||||
|
- No hyper-scaler who can roll over you quickly
|
||||||
|
- Scale could be a barrier to entry but works against most start-ups, not for them
|
||||||
|
- Once developed, answer question: Could a well funded competitor starting up today easily duplicate this business or is it cheaper to buy the start up?
|
||||||
|
|
||||||
|
Founders: Must be religious about their product. Believe they will change the world against all odds.
|
||||||
|
- Just money in the bank is not enough to build a successful company. Just good tech not enough
|
||||||
|
to build a successful company
|
||||||
|
- Founders must be motivated to build something, not (all) about money. They would be doing
|
||||||
|
this for free because they believe in it. Not looking for quick score
|
||||||
|
- Founders must be persuasive. They will be asking others to sacrifice to make their dream come
|
||||||
|
to life. They will need to convince investors this company can work and deserves funding.
|
||||||
|
- Must understand who the customer is and what problem they are helping to solve.
|
||||||
|
- Founders aren’t expected to know all the preceding points in this document but have an understanding of most of this, and be able to offer a vision.
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
AGENDA: Most important things to look for in a start up
|
||||||
|
TAM: Make sure the market is sufficiently large than once they win they can get rewarded
|
||||||
|
Product market fit: Being in a good market with a product than can satisfy that market
|
||||||
|
Unit economics: Profit for delivering all-in cost must be attractive (% or $ amount)
|
||||||
|
LTV CAC: Life-time value (revenue contribution) vs cost to acquire customer must be healthy
|
||||||
|
Churn: Fits into LTV, low churn leads to higher LTV and helps keep future CAC down
|
||||||
|
Business: Must have sufficient barriers to entry to ward off copy-cats once established
|
||||||
|
Founders: Must be religious about their product. Believe they will change the world against all odds.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
Summary of: recordings/42min-StartupsTechTalk.mp4
|
||||||
|
|
||||||
|
The speaker discusses their plan to launch an investment company, which will sit on a pool of cash raised from various partners and investors. They will take equity stakes in startups that they believe have the potential to scale and become successful. The speaker emphasizes the importance of investing in companies that have a large total addressable market (TAM) and good product-market fit. They also discuss the concept of unit economics and how it is important to ensure that the profit from selling a product or service outweighs the cost of producing it. The speaker encourages their team to keep an eye out for interesting startups and to send them their way if they come across any.
|
||||||
|
|
||||||
|
The conversation is about the importance of unit economics, incremental margin, lifetime value, customer acquisition costs, churn, and barriers to entry in evaluating businesses for investment. The speaker explains that companies with good unit economics and high incremental contribution margins are ideal for investment. Lifetime value measures how much a customer will spend on a business over their entire existence, while customer acquisition costs measure the cost of acquiring a new customer. Churn refers to the rate at which customers leave a business, and businesses with low churn tend to have high lifetime values. High barriers to entry, such as high switching costs, can make it difficult for competitors to enter the market and kill established businesses.
|
||||||
|
|
||||||
|
The speaker discusses various factors that can contribute to a company's success and create a competitive advantage. These include making the product addictive, having steep learning curves, creating two-sided liquidity for marketplaces, having patents or intellectual property, strong branding, and scale as a barrier to entry. The speaker also emphasizes the importance of founders having a plan to differentiate themselves from competitors and avoid being rolled over by larger companies. Additionally, the speaker mentions MasterCard and Visa as examples of companies that invented their markets, while Apple was able to build a strong brand despite starting with no developers or users.
|
||||||
|
|
||||||
|
The speaker discusses the importance of founders in building successful companies, emphasizing that they must be passionate and believe in their product. They should also be charismatic and able to persuade others to work towards their vision. The speaker cites examples of successful CEOs such as Zuckerberg, Steve Jobs, Elon Musk, Bill Gates, Jeff Bezos, Travis Kalanick, and emphasizes that luck is also a factor in success. The speaker encourages listeners to have a critical eye when evaluating startups and to look for those with a clear understanding of their customers and the problem they are solving.
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
|||||||
|
GitHub
|
||||||
|
Requirements
|
||||||
|
Junior Developers
|
||||||
|
Riding Elephants
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Summary of: https://www.youtube.com/watch?v=DzRoYc2UGKI
|
||||||
|
|
||||||
|
Small Developer is a program that creates an entire project for you based on a prompt. It uses the JATGPT API to generate code and files, and it's easy to use. The program can be installed by cloning the GitHub repository and using modalcom. The program can create projects for various languages, including Python and Ruby. You can also create a prompt.md file to input your prompt instead of pasting it into the terminal. The program is useful for creating detailed specs that can be passed on to junior developers. Overall, Small Developer is a helpful tool for quickly generating code and projects.
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
11
reflector-local/readme.md
Normal file
11
reflector-local/readme.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Record on Voice Memos on iPhone
|
||||||
|
|
||||||
|
# Airdrop to MacBook Air
|
||||||
|
|
||||||
|
# Run Reflector on .m4a Recording and Agenda
|
||||||
|
|
||||||
|
python 0-reflector-local.py voicememo.m4a agenda.txt
|
||||||
|
|
||||||
|
OR - using 30min-CyberHR example:
|
||||||
|
|
||||||
|
python 0-reflector-local.py 30min-HR-cyber.m4a 30min-HR-cyber-agenda.txt
|
||||||
Reference in New Issue
Block a user