MapReduce Applications
Text retrievalInverted Indexes
A data structure that given a term provides access to the list of documents that contain the term (inverted means we treat the “word” as the key and documents are associated to this word)
Retrieval engine uses the inverted index to score documents that contain the query terms based on some ranking model
Posting: a tuple of (document id, payload) associated with a term
Document ID
Assumed to be a unique integer from 1 to n, where n is the total number of documen ...
Frequent Itemsets & Association Rule Mining
Masket Basket AnalysisMarket-Basket Model
Goal: Identify items that are bought together by sufficiently many customers
Approach: Process the sales data collected with barcode scanners to find dependencies among items
Example:
Association Rules: People who bought {x,y,z} tend to buy {v,w}
Implementation:
Find frequent itemsets
Generate association rules
Applications:
Items = products; Baskets = sets of products someone bought in one trip to the store
Items = documents ( ...
MapReduce Programming
MapReduce ProgrammingHello World
Java WordCount Program:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import java.io.IOException;import java.util.StringTokenizer;import org.apache.hadoop.conf.Configuration;import org.apache.hadoop.fs.Path;import org.apache.hadoop.io.IntWritable;import org.apache.hadoop.io.Text;import org.apache.hadoop.mapreduce.Job;import org.apache.hadoop.mapreduce.Mapper;import org.apache.hadoop.mapreduce.Reducer;im ...
Hadoop Cluster Setup
Hadoop Configuration
Hadoop use a collection of configuration properties and values
Configurations can be either defined in XML files (offline), or defined in programs (online)
Resources are XML files that define properties/values
XML format with name, value, description (optional): 1234567891011121314<?xml version="1.0"?><configuration> <property> <name>size</name> <value>12</value> <description>This is Size< ...
Hadoop Overview
HadoopHadoop is a reliable shared storage and analysis system. The storage is provided by Hadoop Distributed File System (HDFS) and analysis by MapReduce.
MapReduce
MapReduce is a programming model that gives:
Automatic parallelization and distribution
Fault-tolerance
I/O scheduling
Status and monitoring
Properties
same key always go to the same reduce function
all value associated to the same key will appear once and only once
the reduce function cannot start until all map functions are fin ...
Dictionary
Word/Phrase
PoS
Explanation
Synonym
influences_
noun
the effect that somebody/something has on the way a person thinks or behaves or on the way that something works or develops
mimic_
verb
to copy the way somebody speaks, moves, behaves, etc., especially in order to make other people laugh
imitate
enact_
verb
to perform a play or act a part in a play
convincing_
adj
makes somebody believe that something is true
synthetic_
adj
made by combining chemical substances rather than b ...
Paper Reading
2023-06-29
Title: Soft-prompt Tuning for Large Language Models to Evaluate Bias (arXiv 2023)
Author: Jacob-Junqi Tian, David Emerson, Sevil Zanjani Miyandoab, Deval Pandya, Laleh Seyyed-Kalantari, Faiza Khan Khattak
Summary: Soft-prompt tuning is an automatic prompt optimization that can optimize the performance of LLM by training a small set of prompt token embeddings. In this paper, they utilize soft-prompt tuning to evaluate the bias in Open Pre-trained Transformers and Galactica language ...
Research on LLM Psychological Reliability Testing
LLM Psychological Traits and Testing Benchmark
Title: Who is ChatGPT? Benchmarking LLMs’ Psychological Portrayal Using PsychoBench (arXiv:2310.01386)
GitHub: PsychoBench (CUHK-ARISE)
Author: Jen-tse Huang, Wenxuan Wang, Eric John Li, Man Ho Lam, Shujie Ren, Youliang Yuan, Wenxiang Jiao, Zhaopeng Tu, Michael R. Lyu
Abstract: Large Language Models (LLMs) have recently showcased their remarkable capacities, not only in natural language processing tasks but also across diverse domains such as ...
Functional Programming
Functional Programming
supports another form of declarative programming
the building block is true function (no side effect)
The conceptual model of functional programming is that of a pocket calculator
enter an expression, the calculator returns its value 1234- 2 + 2;val it = 4 : int- it;val it = 4 : int
Properties
No Variables Allowed
there is no variable like those we have in imperative programming
we can only declare names and assign values (like constant)
we can reuse the same nam ...
Logic Programming
Declarative Programming
Imperative (Conventional) Languages Properties
State-oriented: each statement execution changes the abstract machine state
Destructive assignment: update the value
Side effects
Difficult to read, write, and verify programs
Declarative languages
Higher program understandability and verifiability
Referential transparency: no side effect
Prolog
Divided into two stages:
Building a program (asserting what is true)
Running a program (asking for consequences of what has ...





